【问题标题】:AAPT: Error retrieving parent for itemAAPT:检索项目的父项时出错
【发布时间】:2017-06-15 21:30:47
【问题描述】:

我一直在努力在 Android 手机上启动我的 ionic 应用程序。当我执行ionic build android 时,我得到这个错误:

: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"

这是我使用 SDK 管理器安装的: 我该如何解决这个问题?

谢谢!

【问题讨论】:

  • 我不确定它是如何为 ionic 工作的,但在 Android 的开发中,这意味着目标 SDK 低于 24,因此显然没有 Material 主题
  • 我安装了 26 和 23 版...当我删除 23 版时,我有一个错误要求我安装它...

标签: android ionic-framework


【解决方案1】:

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

显然您拥有的最新 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

【讨论】:

  • 即使安装了Android SDK Build-tools revision 26 我也有同样的错误:(
  • 是的,刚刚注意到您的 gradle 无论如何都在使用修订版 25 构建工具。看看这是否有任何帮助stackoverflow.com/questions/30899963/…
【解决方案2】:

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

【讨论】:

    猜你喜欢
    • 2016-08-15
    • 2016-03-04
    • 2015-02-10
    • 1970-01-01
    • 2016-02-26
    • 1970-01-01
    • 1970-01-01
    • 2014-12-22
    • 2016-07-23
    相关资源
    最近更新 更多