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即可完美解决上述问题

相关文章:

  • 2021-07-01
  • 2022-12-23
  • 2021-04-10
  • 2021-05-10
  • 2021-04-22
  • 2021-12-31
  • 2021-10-28
猜你喜欢
  • 2021-12-29
  • 2021-06-01
  • 2021-05-28
  • 2021-08-14
  • 2022-12-23
  • 2021-06-17
  • 2021-09-29
相关资源
相似解决方案