找不到任何匹配org.robolectric版本:robolectric:2.3 +(Could n

2019-10-20 11:17发布

当同步Android Studio中我的摇篮的项目,我得到以下错误:

错误:无法找到任何匹配org.robolectric版本:robolectric:2.3 +。 gradle这个:机器人:所要求的不确定

我以为我很想念我的build.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.+'
}

Answer 1:

正如我在评论中说,尝试下探的加号。 从技术上讲,它不应该有所作为(所以为什么我还在犹豫要张贴作为一个答案),但正如我所说,我敢肯定,这发生在我身上了过去。

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



文章来源: Could not find any version that matches org.robolectric:robolectric:2.3.+