2017-02-23 19 views
1

我正在學習我的android應用程序的單元測試。我正在使用roboelectric框架來實現這一點。無法解決:org.roboelectric:roboelectric:3.2.2

的build.gradle

apply plugin: 'com.android.application' 
apply plugin: 'realm-android' 

android { 
    compileSdkVersion 25 
    buildToolsVersion "25.0.2" 
    defaultConfig { 
     applicationId "com.xyz.helloworld" 
     minSdkVersion 15 
     targetSdkVersion 25 
     versionCode 1 
     versionName "1.0" 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 

    dataBinding { 
     enabled = true 
    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
     exclude group: 'com.android.support', module: 'support-annotations' 
    }) 
    compile 'com.android.support:appcompat-v7:25.1.1' 
    testCompile 'junit:junit:4.12' 
    testCompile 'org.robolectric:robolectric:3.2.2' 
} 

我正在用搖籃多次同步錯誤Failed to resolve: org.roboelectric:roboelectric:3.2.2 &。

enter image description here 我該如何解決這個問題?在此先感謝

+0

call'compile group:'org.robolectric',name:'robolectric',version:'3.2.2'' –

+0

你可以試試'testCompile'org.robolectric:robolectric:3.2.1「' –

+0

Do你在你的倉庫部分包含mavenCentral()? –

回答

1

這是一些代理kinda問題。我切換到不同的網絡,然後它爲我工作。謝謝