【问题标题】:AAPT: No resource found that matches the given nameAAPT:找不到与给定名称匹配的资源
【发布时间】:2016-03-09 20:20:15
【问题描述】:

我正在我的 Linux 机器上开发一个离子应用程序,当我运行 $ ionic run android 时,它会在构建过程中到达 :processDebugResources,然后才会出现错误消息

App/platforms/android/build/intermediates/manifests/full/debug/AndroidManifest.xml:43:23-37 : AAPT: No resource found that matches the given name (at 'icon' with value '@drawable/icon')

Execution failed for task ':processDebugResources'. com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Android/Sdk/build-tools/23.0.2/aapt'' finished with non-zero exit value 1

我可以通过网络浏览器测试大多数功能,但我已经到了需要在实际设备上测试功能的项目中。

【问题讨论】:

  • 看来您的 res/drawable 文件夹中没有 icon.png 或类似文件?
  • @GONeale 当我将 Android 添加到我的项目时,该文件是自动生成的。我已经厌倦了更改值,但是当我尝试运行部署命令时它会覆盖它。

标签: android linux ionic-framework


【解决方案1】:

您需要运行ionic resources,它将创建资源目录并添加图标。

【讨论】:

  • 这可能是答案,但是,写一个描述并解释为什么会这样。
【解决方案2】:

使用某些资源的自定义插件遇到了同样的问题。在我的情况下,通过将资源文件直接添加到平台来解决问题(在 Android 上,它是插件 /res 目录中的内容,复制到 platforms/android/res)。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-09-26
    相关资源
    最近更新 更多