0

I have been struggling with launching my ionic app on an android phone. When I execute ionic build android, I get this error:

:processDebugResources C:\mobileProject\platforms\android\build\intermediates\res\merged\debug\values-v24\values-v24.xml:3 : AAPT: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.
 FAILED

C:\mobileProject\platforms\android\build\intermediates\res\merged\debug\values-v24\values-v24.xml:4 : AAPT: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.


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 'C:\Users\lma3466\AppData\Local\Android\android-sdk\build-tools\25.0.1\aapt.exe'' finished with non-zero exit value 1


BUILD FAILED

Total time: 1 mins 17.731 secs
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
ERROR building one of the platforms: Error code 1 for command: cmd with args: /s,/c,"C:\mobileProject\platforms\android\gradlew cdvBuildDebug -b C:\pmobileProject\platforms\android\build.gradle -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true"
You may not have the required environment or OS to build this project
Error: Error code 1 for command: cmd with args: /s,/c,"C:\mobileProject\platforms\android\gradlew cdvBuildDebug -b C:\mobileProject\platforms\android\build.gradle -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true"

This is what I have installed mith my SDK manager:SDK manager How can I solve this?

Thanks!

Anna
  • 839
  • 2
  • 17
  • 33
  • I'm not sure how it's working for ionic but in Android's development it means that target SDK is lower than 24 so obviously there is no Material theme – Selvin Jun 15 '17 at 09:34
  • I have the version 26 and 23 installed... When I deleted the version 23, I had an error asking me to install it... – Anna Jun 15 '17 at 10:11

2 Answers2

0

You need to have installed the same revision of Android SDK Build-tools as the Android API you are using.

Apparently the latest API you have is Android 8.0.0 (API 26), but you don't have Android SDK Build-tools revision 26 installed.

Also try ionic platform remove android && ionic platform add android in your terminal.

By the way, you probably don't need to install all these system images. These are huge in size and you only install what you need for your emulator, usually just the Intel x86 Atom System Image.

maninak
  • 2,633
  • 2
  • 18
  • 33
  • I have the same error even with installing `Android SDK Build-tools revision 26` :( – Anna Jun 15 '17 at 12:39
  • Yeah, just noticed your gradle is utilizeing revision 25 build tools anyway. See if this is of any help https://stackoverflow.com/questions/30899963/how-to-fix-22-0-1-aapt-exe-finished-with-non-zero-exit-value-1#30900651 – maninak Jun 15 '17 at 12:42
0

Updating Cordova to 6.5.0 solved my problem...

Anna
  • 839
  • 2
  • 17
  • 33