- (27,17) Failed to resolve: junit:junit:4.12
- Failed to resolve: javax.inject:javax.inject:1
- Failed to resolve: javax.annotation:javax.annotation-api:1.2
- Failed to resolve: com.google.code.findbugs:jsr305:2.0.1
- Failed to resolve: org.hamcrest:hamcrest-library:1.3
- Failed to resolve: org.hamcrest:hamcrest-integration:1.3
- Failed to resolve: com.squareup:javawriter:2.1.1
遇到此问题需要是因为依赖的问题,需要删除代码中的依赖关系:
需要在MyApplication/app/build.gradle文件中删除未知依赖库:
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' }) testCompile 'junit:junit:4.12'
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Remove the unwanted libraries from the build.gradle
,
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'
})
testCompile 'junit:junit:4.12'
and also
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"