Execution failed for task :processDebugResources [

2019-01-20 05:12发布

问题:

I have created an application with Cordova and Ionic. I received Application build success on iOS.

I am trying to build this application on Android (via cordova build android) I have this error :

:processDebugResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
 Execution failed for task ':processDebugResources'.
 > com.android.ide.common.process.ProcessException:      org.gradle.process.internal.ExecException: Process 'command '/Users/me/Library/Android/sdk/build-tools/24.0.0/aapt'' finished with non-zero exit value 1

* Try:
 Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

 BUILD FAILED

 Total time: 3.937 secs
 Error: Error code 1 for command: /Users/me/Desktop/Développement/Multi-plateforme/myApp/platforms/android/gradlew with args: cdvBuildD

I have downloaded / updated every version of build-tools I can from the Android SDK Manager

I also verified that the project doesn't content "node_modules" or "bower_modules" folders in "/www/" directory and the extension + name of every single image in the project.

Here is my system configuration :

Cordova CLI: 6.2.0
 Ionic Framework Version: 1.3.1
 Ionic CLI Version: 1.7.15
 Ionic App Lib Version: 0.7.2
 ios-deploy version: 1.8.5 
 ios-sim version: 3.1.1 
 OS: Mac OS X El Capitan
 Node Version: v4.1.2
 Xcode version: Xcode 7.3 Build version 7D175 

Here are the topics I've checked before writing this question :

  • Cordova build android error Execution failed for task ':processDebugResources'

  • Android: Execution failed for task ':app:processDebugResources'

  • Error:Execution failed for task ':app:processDebugResources'.

  • ionic run android: Build failed with an exception

I really hope someone will help me ! ;)

回答1:

Solved by rename every filename who content a special character (image but also html template, javascript file, css)



回答2:

I had the same problem. The problem in my case occured because i had a "wrong" name for a picture. I had a greek character in one name of a picture. As a start move your folder with the images out of your folder of the app and try to build again.

I dont tell that it will solve your problem but it soved mine.

Hope that it will help you.



回答3:

I had this because of files in ./node_modules/.bin/ solved by removing node_modules entirely after building.



回答4:

After hours of trying to figure out my issue,

Another reason why this can happen, if you have the same file name in upper case and in lower case,

for example i had:

Leather.jpg and leather.jpg in the same folder.



回答5:

It solved my issue by adding xml namespace for phonegap (xmlns:gap="http://phonegap.com/ns/1.0") to config.xml

also, if you are using linux you must do "sudo chmod 755 gradlew" before you do the "./gradlew clean" to make sure it is executable.

Install another version of JDK (version 8u92) and change environment variable JAVA_HOME to the new location.

Clean the project and when you build it again, it should be working.



回答6:

Try this:


You can solve this problem by installing Android SDK Platform 24 and Android 
SDK Platform 23  and Sources for Android 23.


回答7:

I had this same issue while using Cordova, it turns out the I had renamed my widget ID incorrectly in my Cordova config.xml file.

The Android App manifest requires names to be supplied in a javascript style using periods '.'. For example I had changed my widget ID to 'george-cordova-test', however it needed to be 'com.george.test' as this name is passed down and used in the android app manifest.

I have included the section from the docs below:

A full Java-language-style package name for the Android application. The name should be unique. The name may contain uppercase or lowercase letters ('A' through 'Z'), numbers, and underscores ('_'). However, individual package name parts may only start with letters. To avoid conflicts with other developers, you should use Internet domain ownership as the basis for your package names (in reverse). For example, applications published by Google start with com.google. You should also never use the com.example namespace when publishing your applications.

The package name serves as a unique identifier for the application. It's also the default name for the application process (see the element's process process attribute) and the default task affinity of an activity (see the element's taskAffinity attribute).

I imagine that I should probably have known this, but it took me a while to work it out, so if it helps anyone then that's great.



回答8:

It mainly caused by the in-suitable of the cordova plugin with the current android paltform. Would you pls check your config.xml, and find the android-version, if it is: 7, please try to delete all your platform fold and type:ionic cordova platform add android@6.3