17

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!

Cœur
  • 37,241
  • 25
  • 195
  • 267
Caio Frota
  • 185
  • 1
  • 1
  • 7

4 Answers4

18

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

configurations.all {
    resolutionStrategy {
        force 'com.android.support:support-v4:27.1.0'
    }
}
Mahdi Bashirpour
  • 17,147
  • 12
  • 117
  • 144
Codeblooded Saiyan
  • 1,457
  • 4
  • 28
  • 54
5

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

Strong
  • 99
  • 8
1

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.

Ojonugwa Jude Ochalifu
  • 26,627
  • 26
  • 120
  • 132
0

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
Sahan
  • 29
  • 2