Android studio v2.2.2 error(27,17) failed to resolve junit:junit4.12

在Android Studio v2.2.2中遇到了(27,17)错误,无法解析junit:junit:4.12等多个依赖。解决方法是检查并删除app/build.gradle文件中的无效依赖库。" 132961507,19974110,嵌入式系统开发流程详解,"['嵌入式开发', 'Arduino', 'FreeRTOS', '软件开发', '硬件选择']
  1. (27,17) Failed to resolve: junit:junit:4.12
  2. Failed to resolve: javax.inject:javax.inject:1
  3. Failed to resolve: javax.annotation:javax.annotation-api:1.2
  4. Failed to resolve: com.google.code.findbugs:jsr305:2.0.1
  5. Failed to resolve: org.hamcrest:hamcrest-library:1.3
  6. Failed to resolve: org.hamcrest:hamcrest-integration:1.3
  7. 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"
11down voteaccepted

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"
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值