Caio Frota
Caio Frota

Reputation: 185

com.android.ide.common.process.ProcessException: Failed to execute aapt! What can I do?

I’m getting error when I'm trying to run on Android Device! I have no idea what is happening!

What can I do to solve it?

FAILURE: Build failed with an exception.

BUILD FAILED

Total time: 7.791 secs

* What went wrong:
Execution failed for task ':processDebugResources'.
> com.android.ide.common.process.ProcessException: 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.
Error: cmd: Command failed with exit code 1 Error output:
C:\tmp\myproj\platforms\android\build\intermediates\res\merged\debug\values\values.xml:373: AAPT: Attribute "theme" already defined with incompatible format.

C:\tmp\myproj\platforms\android\build\intermediates\res\merged\debug\values\values.xml:359: AAPT: Original attribute defined here.

C:\tmp\myproj\platforms\android\build\intermediates\res\merged\debug\values-v26\values-v26.xml:15:21-54: AAPT: No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.

C:\tmp\myproj\platforms\android\build\intermediates\res\merged\debug\values\values.xml:373: error: Attribute "theme" already defined with incompatible format.
C:\tmp\myproj\platforms\android\build\intermediates\res\merged\debug\values\values.xml:359: Original attribute defined here.
C:\tmp\myproj\platforms\android\build\intermediates\res\merged\debug\values-v26\values-v26.xml:15: error: Error: No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.



FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':processDebugResources'.
> com.android.ide.common.process.ProcessException: 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.

[ERROR] An error occurred while running cordova run android (exit code 1).

Solved

Solved: Re-create the project and add the features again!

Upvotes: 17

Views: 41903

Answers (4)

Sahan
Sahan

Reputation: 39

this problem comes from the mismatch project environment and executing platform environment. try to create a new project and run in the same platform environment. if its run, copy-paste old project src files.

$ ionic start 
$ cd "project_name"
$ ionic cordova platform add android
$ ionic cordova run android
copy-paste old project src files

Upvotes: 0

Codeblooded Saiyan
Codeblooded Saiyan

Reputation: 1497

just put this code inside build.gradle on the last part

configurations.all {
    resolutionStrategy {
        force 'com.android.support:support-v4:27.1.0'
    }
}

Upvotes: 18

Ojonugwa Jude Ochalifu
Ojonugwa Jude Ochalifu

Reputation: 27257

Strange cause of this error for me was that I was missing a drawable from a layout. I copied the layout from another project and forgot to copy the drawable before running my project. Also, check that the activity names in your layouts do not have spaces.

Upvotes: 1

Strong
Strong

Reputation: 99

If you update the v4 v7 version to 26.0.0, you also should change the CompileSdkVersion and BuildToolsVersion to 26.0.0

Upvotes: 5

Related Questions