Reputation: 772
Then on building or launhcing on my device i get following error:
Could not determine the dependencies of task ':app:compileFreeDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:freeDebugCompileClasspath'.
> Could not resolve project :capacitor-android.
Required by:
project :app
> No matching configuration of project :capacitor-android was found. The consumer was configured to find an API of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'minApi' with value '____free', attribute 'tier' with value 'free', attribute 'abi' with value 'x86' but:
- None of the consumable configurations have attributes.
It is building my project using grable.
I have tried Build Clean, Build Rebuild and File > Invlaidate Caches and Resatrt as well.
Kindly help.
Upvotes: 0
Views: 1197
Reputation: 11
I had the same error, in my case the android folder was generated in wsl and copied in a windows folder to build the apk with android studio, is necesary the node_modules folder because android project have a reference to ../node_modules/@capacitor/.....
You can copy the node_modules or just the package.json and run npm install
The android and node_modules folder need to be at the same level
Upvotes: 1
Reputation: 772
Installing jetifier solved my error
by executing npm install jetifier
Jetifier tool migrates support-library-dependent libraries to rely on the equivalent AndroidX package
Upvotes: 1