Execution failed for task ':app:processDebugResources'
This error occurs when I run -
Cordova build android
Full Error -
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Failed to execute aapt
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 10s
at ChildProcess.whenDone (/Users/anujsingh/Documents/ionic/logs/platforms/android/cordova/node_modules/cordova-common/src/superspawn.js:169:23)
at ChildProcess.emit (events.js:182:13)
at maybeClose (internal/child_process.js:961:16)
at Socket.stream.socket.on (internal/child_process.js:380:11)
at Socket.emit (events.js:182:13)
at Pipe._handle.close [as _onclose] (net.js:595:12)
(node:637) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
ionic info
cli packages: (/usr/local/lib/node_modules)
@ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0
global packages:
cordova (Cordova CLI) : 8.0.0
local packages:
@ionic/app-scripts : 3.1.10
Cordova Platforms : android 7.0.0
Ionic Framework : ionic-angular 3.9.2
System:
Android SDK Tools : 26.1.1
Node : v10.4.1
npm : 6.1.0
OS : macOS High Sierra
Environment Variables:
ANDROID_HOME : /Users/anujsingh/Library/Android/sdk
Misc:
backend : pro
I tried every previous given solution in the forum
@anujsinghwd You're still not filling out the issue template. The more information provided the easier I can help you. This is more of a support request anyway, but perhaps we can help some people from Google if they arrive.
- Are you running
ionic cordova build androidorcordova build android(directly)? - What exactly have you tried to resolve this issue?
- Link to the topic in the forum and any other issues that are related.
From googling around, it looks like this issue is related to a mismatch between Cordova and the Android SDK. Have you tried updating the SDK?
sorry @dwieeb I forget to mention this
- I tried with
ionic cordova build android or cordova build androidboth and get same error. - I also tried after updating the android sdk and get the same error.
- it's not building the APK this is the issue
- I googled the same issue and find in forum but that solution is not worked for me
@anujsinghwd You need to link to the topic, otherwise I have no idea what the solution you tried is.
Is this the topic? https://forum.ionicframework.com/t/failed-build-for-android-execution-failed-for-task-app-processdebugresources/124551
- If so, are you using
cordova-plugin-facebook4? - If not, please send a link to the issue so I can help.
Can you please look in your config.xml for settings regarding SDK version:
android-minSdkVersionandroid-maxSdkVersionandroid-targetSdkVersion
Post the relevant lines to this issue.
I have no insight into your local project, so it's helpful to post as much information as you can.
thank you @dwieeb
this resolved my issue. thanks again
@anujsinghwd What exactly resolved the issue? Please post the solution so future readers can be helped as well.
This resolves my issue :-
Go to platforms/app/src/main/res/values/strings.xml and add these lines :
<string name="fb_app_id">Your Facebook APP ID</string>
<string name="fb_app_name">YOur Facebook App Name</string>
Hellow anujsingh What should i do if i am using cordova plugin googlmaps
This resolves my issue :- Go to
platforms/app/src/main/res/values/strings.xmland add these lines :<string name="fb_app_id">Your Facebook APP ID</string> <string name="fb_app_name">YOur Facebook App Name</string>
Thanks this worked for me.
I am facing the issue due to latest updates of firebase and google , need help https://github.com/arnesson/cordova-plugin-firebase/issues/1089
my application has worked with facebook4 login, but by removing and re-adding the facebook4 plugin with the variables it has generated a mess in my application since it does not build well on the android platform.
cli packages: (/Users/user/Desktop/home-made-repo/node_modules)
@ionic/cli-utils : 1.19.3 ionic (Ionic CLI) : 3.20.1 global packages:
cordova (Cordova CLI) : 8.0.0 local packages:
@ionic/app-scripts : 3.2.4 Cordova Platforms : android 6.4.0 ios 4.5.5 Ionic Framework : ionic-angular 3.9.2 System:
Android SDK Tools : 26.1.1 Node : v8.15.0 npm : 6.4.1 OS : macOS Xcode : Xcode 10.2.1 Build version 10E1001 Environment Variables:
ANDROID_HOME : /Users/user/Library/Android/sdk/ Misc:
backend : pro try to manually add the variables to the platforms / android / res / values / string as suggested in https://stackoverflow.com/a/48713244/11369978
but this only brought me another problem, now What went wrong: the execution failed for the task ': mergeDebugResources'.
ionic cordova plugin add cordova-plugin-facebook4 --variable APP_ID="XXXXXXXX" --variable APP_NAME="XXXXXXXX"
ionic cordova build android
I expected to build android successful and I got error
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':mergeDebugResources'. [string/fb_app_id] /Users/user/Desktop/home-made-repo/platforms/android/res/values/facebookconnect.xml [string/fb_app_id] /Users/user/Desktop/home-made-repo/platforms/android/res/values/strings.xml: Error: Duplicate resources [string/fb_app_name] /Users/user/Desktop/home-made-repo/platforms/android/res/values/facebookconnect.xml [string/fb_app_name] /Users/user/Desktop/home-made-repo/platforms/android/res/values/strings.xml: Error: Duplicate resources
Hi All I got same issue after implementing android adaptive icons when I run ionic cordova build android cmd. https://stackoverflow.com/questions/47523610/android-oreo-how-do-i-set-adaptive-icons-in-cordova I am not using facebook plugin google and firebase. I am using ionic 4 with [email protected] I have tried many solutions but that did not work