【问题标题】:cordova error building project: Android resource linking failed科尔多瓦错误构建项目:Android资源链接失败
【发布时间】:2021-11-22 08:45:53
【问题描述】:

我正在尝试构建 cordova android 项目,这就是我得到的:

> Task :app:processDebugResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Android resource linking failed

cordova/platforms/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:2548: AAPT: error: resource android:attr/lStar not found.

该项目过去常常工作,这只是从哪里发生的。尝试删除android平台并重新安装并得到越来越多的问题。

更新

现在我收到了这个错误:

Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find com.intentfilter:android-permissions:0.1.8.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/intentfilter/android-permissions/0.1.8/android-permissions-0.1.8.pom
       - https://repo.maven.apache.org/maven2/com/intentfilter/android-permissions/0.1.8/android-permissions-0.1.8.pom
       - .../cordova/platforms/android/app/libs/com/intentfilter/android-permissions/0.1.8/android-permissions-0.1.8.pom
     Required by:
         project :app

【问题讨论】:

  • 运行命令ionic cordova resources android.
  • 我没有使用离子
  • 只需使用cordova resources android
  • Cordova 不知道资源;尝试cordova help 获取所有可用命令的列表。
  • 粘贴 values.xml

标签: android cordova


【解决方案1】:

这与任何一个都没有关系,因为忽略的错误消息如下:

找不到com.intentfilter:android-permissions:0.1.8

添加mavenCentral()作为存储库,以便让Gradle下载AAR:
https://mvnrepository.com/artifact/com.intentfilter/android-permissions/0.1.8

【讨论】:

    【解决方案2】:

    检查 npm 版本。除了其他错误之外,我也遇到了同样的情况。尝试将 npm 升级到最新的主要版本。

    如果你有 lockfile v1 而不是 v2,我 99% 肯定是这个。

    仅供参考,这件事刚刚发生在我身上。我已经安装了 docker(另一个项目),然后回去构建应用程序,我遇到了同样的原始错误。我还尝试重新添加 node_modules/ 和 cordova 平台。没用。

    【讨论】:

      【解决方案3】:

      我遇到了同样的错误,我可以修复它的唯一方法是删除并重新添加一些 cordova 插件。我不确定是哪一个导致了它(因为更新了不止一个),但问题已经解决了。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2023-03-06
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多