我正在学习如何使用 cordova 构建应用程序,目前我能够通过 google chrome 浏览器模拟移动屏幕。我正在尝试在需要使用 Android studio(下载 3.0 稳定版)的 android 平台上对其进行测试。导入项目后,Gradle 项目同步失败 并且似乎无法解决 CordovaLib 的某些依赖项。见下图
我在这里浏览了几篇文章,但仍然无法找到解决方案,或者考虑到这是我第一次学习它,我可能忽略了这一点。以下是
的设置build.gradle(模块:CordovaLib)
和build.gradle(Module: android)
请问我该如何解决这个问题并在模拟器中运行我的应用程序?
最佳答案
是migration的典型错误,请阅读“迁移本地模块的依赖配置”段落:
You should instead configure your dependencies as follows:
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'
}
关于android - 无法解析项目 : CordovaLib,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47263668/