After I run Cordova on android “cordova run android / cordova build” I I got the following error :
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ‘:app:processDebugResources’.
Failed to execute aapt
any thought how we can fix this I tried build/clean didn’t work.
Thanks in Advance.
Solution :
I’m having the same problem, on Friday I did the build normally and on Monday when trying to perform again I get the error ‘Execution failed for task’: app: processDebugResources’” plus some stacktrace on Aapt2Exception: AAPT2 error.
Apparently this has to do with Google launching new versions of support-v4 and api-level update
this link say that installing the cordova-android-support-gradle-release plugin solves the problem.
add the code below in build.gradle in the platforms / android directory
configurations.all {
resolutionStrategy.force ‘com.android.support:support-v4:27.1.0’
}
In my case it did not solve, but I may have done something wrong, I hope it will solve.
-– UPDATE 1
Google has released an update of Google Play service libraries and Firebase on June 17, 2019, I believe our problem is directly related to this. They recommend the following settings:
Upgrade com.android.tools.build:gradle to v3.2.1 or later.
Upgrade compileSdkVersion to 28 or later.
Update the app to use Jetpack (AndroidX); follow the instructions in Migrating to AndroidX.
In the case of Cordova applications I still do not know exactly how to reflect these changes and I’m in the middle of a release cycle of an update of my app, without being able to build, it’s really sad :(
PS:Sorry for my bad English.