![](/img/trans.png)
[英]Error:Unable to resolve dependency for ':@debug/compileClasspath': Could not resolve project :CordovaLib
[英]Could not resolve project: CordovaLib
是典型的遷移錯誤,請閱讀“遷移本地模塊的依賴關系配置”一節:
您應該按如下方式配置依賴項:
dependencies {
// This is the old method and no longer works for local
// library modules:
// debugImplementation project(path: ':library', configuration: 'debug')
// releaseImplementation project(path: ':library', configuration: 'release')
// Instead, simply use the following to take advantage of
// variant-aware dependency resolution. You can learn more about
// the 'implementation' configuration in the section about
// new dependency configurations.
implementation project(':library')
// You can, however, keep using variant-specific configurations when
// targeting external dependencies. The following line adds 'app-magic'
// as a dependency to only the "debug" version of your module.
debugImplementation 'com.example.android:app-magic:12.3'
}
trocchietto的解決方案是正確的。 記住你正在使用“CordovaLib”沒有“圖書館”,你只需要像這樣改變。
// Instead, simply use the following to take advantage of
// variant-aware dependency resolution. You can learn more about
// the 'implementation' configuration in the section about
// new dependency configurations.
implementation project(':CordovaLib')
然而,對我來說app-magic並不是必需的,我對它進行了評論。
我的依賴
dependencies {
// This is the old method and no longer works for local
// compile 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
// Instead, simply use the following to take advantage of
// variant-aware dependency resolution. You can learn more about
// the 'implementation' configuration in the section about
// new dependency configurations.
implementation project(':CordovaLib')
// You can, however, keep using variant-specific configurations when
// targeting external dependencies. The following line adds 'app-magic'
// as a dependency to only the "debug" version of your module.
//debugImplementation 'com.example.android:app-magic:12.3'
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.