gpt4 book ai didi

android - 找不到与 org.robolectric :robolectric:2. 3.+ 匹配的任何版本

转载 作者:行者123 更新时间:2023-11-29 17:48:33 26 4
gpt4 key购买 nike

在 Android Studio 中同步我的 Gradle 项目时,出现以下错误:

Error:Could not find any version that matches org.robolectric:robolectric:2.3.+. Required by: gradle:android:unspecified

我假设我的 build.gradle 文件中缺少一个存储库。我是 Gradle 和 Maven 的新手,所以我不确定应该放什么。有什么建议吗?

这是我的 build.gradle 文件:

项目:

buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.+'
classpath 'com.github.jcandksolutions.gradle:android-unit-test:1.2.+'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
mavenCentral()
}
}

模块:

apply plugin: 'android'

android {
compileSdkVersion 19
buildToolsVersion "19.1.0"

defaultConfig {
applicationId "bbct.android.common"
minSdkVersion 11
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
signingConfigs {
release
}
buildTypes {
release {
signingConfig signingConfigs.release
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
lite {
applicationId "bbct.android"
versionCode 15
versionName "0.6.2"
}
premium {
applicationId "bbct.android.premium"
versionCode 14
versionName "0.6.2"
}
}
def Properties props = new Properties()
def propFile = new File('signing.properties')
if (propFile.canRead()) {
props.load(new FileInputStream(propFile))

if (props!=null && props.containsKey('STORE_FILE') && props.containsKey('STORE_PASSWORD') &&
props.containsKey('KEY_ALIAS') && props.containsKey('KEY_PASSWORD')) {
android.signingConfigs.release.storeFile = file(props['STORE_FILE'])
android.signingConfigs.release.storePassword = props['STORE_PASSWORD']
android.signingConfigs.release.keyAlias = props['KEY_ALIAS']
android.signingConfigs.release.keyPassword = props['KEY_PASSWORD']
} else {
println 'signing.properties found but some entries are missing'
android.buildTypes.release.signingConfig = null
}
} else {
println 'signing.properties not found'
android.buildTypes.release.signingConfig = null
}
}

apply plugin: 'android-unit-test'

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:19.1.0'
compile 'com.android.support:support-v4:19.1.0'
compile 'com.google.android.gms:play-services:4.2.42'
liteCompile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile 'com.jayway.android.robotium:robotium-solo:5.1'
androidTestCompile ('com.squareup:fest-android:1.0.8') {
exclude group: 'com.android.support'
}
testCompile 'junit:junit:4.10'
testCompile 'org.robolectric:robolectric:2.3.+'
}

最佳答案

正如我在评论中所说,尝试去掉加号。从技术上讲,它不应该有什么不同(因此我犹豫是否将其作为答案发布),但正如我所说,我很确定这在过去发生在我身上。

很高兴它解决了您的问题。 :)

关于android - 找不到与 org.robolectric :robolectric:2. 3.+ 匹配的任何版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24708230/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com