码迷,mamicode.com
首页 > 移动开发 > 详细

Android Studio 3.0——unable to resolve dependency for cordovalib

时间:2019-12-11 18:59:50      阅读:84      评论:0      收藏:0      [点我收藏+]

标签:ova   pen   file   问题   tar   ali   star   完美解决   gradle   

Android Studio 3.0 更新了gradle后,项目竟然开始报错unable to resolve dependency for cordovalib...打开build.gradle看了后其中dependencies是这样写的

dependencies {
   compile fileTree(dir: libs, include: *.jar)
// SUB-PROJECT DEPENDENCIES START
debugCompile(project(path: "CordovaLib", configuration: "debug")) 
releaseCompile(project(path: "CordovaLib", configuration: "release"))
感觉没毛病,非常nice,于是特地查了下3.0版的dependencies是否有变动,一查果然有妖孽作祟,如果你没有一个libary项目,原来的写法并不会有问题,但加入一个lib的写法
需做如下改动
dependencies {
    implementation fileTree(dir: libs, include: *.jar)
    // SUB-PROJECT DEPENDENCIES START
//    debugCompile(project(path: "CordovaLib", configuration: "debug"))
//    releaseCompile(project(path: "CordovaLib", configuration: "release"))
    // SUB-PROJECT DEPENDENCIES END
    implementation project(:CordovaLib)
    debugImplementation project(:CordovaLib)
    releaseImplementation project(:CordovaLib)
}

将compile替换成implementation即可完美解决上述问题

Android Studio 3.0——unable to resolve dependency for cordovalib

标签:ova   pen   file   问题   tar   ali   star   完美解决   gradle   

原文地址:https://www.cnblogs.com/colder/p/12024351.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!