Could not resolve project: CordovaLib

Viewed 9360

I'm learning how to build app using cordova and I'm currently able to emulate a mobile screen via google chrome browser. I'm attempting to test it on android platform which requires using Android studio (downloaded the 3.0 stable version). After importing the project, Gradle project sync failed and there seems to be issues resolving some dependencies for CordovaLib. See image below

enter image description here

I have gone through several post here and still haven't been able to find a solution or maybe I'm missing the point considering that this is my first time learning with it. Below are the settings for

build.gradle(Module: CordovaLib)

enter image description here

and build.gradle(Module: android)

enter image description here

Please how do i fix the issue and run my app in an emulator?

2 Answers

Is a typical error of migration, please read the paragraph 'Migrate dependency configurations for local modules':

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'
}
Related