android - 无法解析项目 : CordovaLib

标签 android cordova android-studio

我正在学习如何使用 cordova 构建应用程序,目前我能够通过 google chrome 浏览器模拟移动屏幕。我正在尝试在需要使用 Android studio(下载 3.0 稳定版)的 android 平台上对其进行测试。导入项目后,Gradle 项目同步失败 并且似乎无法解决 CordovaLib 的某些依赖项。见下图

enter image description here

我在这里浏览了几篇文章,但仍然无法找到解决方案,或者考虑到这是我第一次学习它,我可能忽略了这一点。以下是

的设置

build.gradle(模块:CordovaLib)

enter image description here

和build.gradle(Module: android)

enter image description here

请问我该如何解决这个问题并在模拟器中运行我的应用程序?

最佳答案

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/

相关文章:

java - 如何在 Android Studio 中创建项目特定的文件模板?

android - 使用android studio混淆多个模块

java - Android 在运行时无法从 JAR 中找到方法

android - 如何在 wearOS android 中默认添加并发症

android - 如何暂停和恢复 surfaceView 线程

android - Recyclerview 不保留我的滚动位置

javascript - Ionic 与谷歌分析

eclipse - 三星 Galaxy S4 和 Phonegap 问题

android - MapView 和 Expandablelistview 滚动

java - OnBootReceiver 可以工作,但找不到 AlarmReceiver