恢弘志士之气,不宜妄自菲薄。这篇文章主要讲述Android Studio 3.0——unable to resolve dependency for cordovalib相关的知识,希望能为你提供帮助。
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‘) }
【Android Studio 3.0——unable to resolve dependency for cordovalib】将compile替换成implementation即可完美解决上述问题
推荐阅读
- Configuration on demand is not supported by the current version of the Android Gradle plugin since y
- Android Telephony分析 ---- 接口扩展(实践篇)
- APP接口测试和功能测试点
- (十五)连接网络adb,android模拟器打开
- Android Telephony分析 ---- 接口扩展(异步转同步)
- 虹软人脸识别3.0 - 图像数据结构介绍(Android)
- android下载网络图片,设置宽高,等比缩放
- understanding android build layer · Dylan
- 百度网盘批量添加前后缀安卓版