AAPT: Error retrieving parent for item

时间:2017-06-15 09:23:18

标签: android ionic-framework

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!

2 个答案:

答案 0 :(得分:0)

您需要安装与您正在使用的revision相同的Android SDK Build-tools Android API

显然您拥有的最新API是Android 8.0.0 (API 26),但您没有安装Android SDK Build-tools revision 26

还可以在终端中尝试ionic platform remove android && ionic platform add android

顺便说一下,您可能不需要安装所有这些系统映像。它们的大小非常大,您只需安装模拟器所需的内容,通常只需Intel x86 Atom System Image

答案 1 :(得分:0)

将Cordova更新到6.5.0解决了我的问题...