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
&。
call'compile group:'org.robolectric',name:'robolectric',version:'3.2.2'' –
你可以試試'testCompile'org.robolectric:robolectric:3.2.1「' –
Do你在你的倉庫部分包含mavenCentral()? –