cordova error building project: Android resource linking failed

Viewed 1080

I am trying to build the cordova android project and thats what I got:

> Task :app:processDebugResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Android resource linking failed

cordova/platforms/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:2548: AAPT: error: resource android:attr/lStar not found.

The project was used to work, this just happened from no where. Tried to remove the android platform and reinstall and got more and more issues.

UPDATE

Now I got this error:

Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find com.intentfilter:android-permissions:0.1.8.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/intentfilter/android-permissions/0.1.8/android-permissions-0.1.8.pom
       - https://repo.maven.apache.org/maven2/com/intentfilter/android-permissions/0.1.8/android-permissions-0.1.8.pom
       - .../cordova/platforms/android/app/libs/com/intentfilter/android-permissions/0.1.8/android-permissions-0.1.8.pom
     Required by:
         project :app
3 Answers

Check npm version. Apart from additional errors, I had the same situation. Try to upgrade npm to latest major release.

If You have lockfile v1 instead of v2, I am 99% sure it's this.

FYI it happened to me just now. I have installed docker (another project), then went back to build the app and I had the same, original error. Also I have tried to re-add node_modules/ and cordova platform. Didn't work.

I got the same error and the only way I could fix it was removing and re-adding some cordova plugins. I'm not sure which of them was causing it (because more then one were updated), but the problem is solved.

Related