android - :app:mergeDebugResources FAILED Error: java. util.concurrent.ExecutionException : com. android.builder.internal.aapt.AaptException

标签 android jenkins gradle

当我运行 gradlew assembleDebug 时,Jenkins 返回以下错误。 在 Android Studio 3.0 中我没有这个问题。 有谁知道原因吗?

AAPT err(Facade for 2147483181): \\?\C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-25.3.1.aar\e9979393938d5eeff956c6f4b76be0a3\res\drawable-xxhdpi-v4\abc_switch_track_mtrl_alpha.9.png ERROR: Unable to open PNG file
:app:mergeDebugResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> Error: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.AaptException: 

* Try:
Run with --info or --debug option to get more log output.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:mergeDebugResources'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:63)
    at 

我尝试了什么

gradle.properties

android.enableAapt2=false
android.enableBuildCache=true#and false
android.buildCacheDir=c:/temp/

最佳答案

您是否单独应用这些操作?

  • 检查您的项目的路径。如果路径太长,请将项目上移到上层目录。
  • 如果路径包含非 ASCII 字符,请更正它。
  • 清除构建缓存。请参阅this page了解详情。

在 Windows 上:

gradlew cleanBuildCache

在 Mac 或 Linux 上:

./gradlew cleanBuildCache

  • Go to gradle.properties file, and disable build cache.

    // To re-enable the build cache, either delete the following

    // line or set the property to 'true'.

    android.enableBuildCache=false the other way is to modify build cache dir by adding first line can be skipped because true is the default value by 2.3

    android.enableBuildCache=true

    android.buildCacheDir =c:\temp\

  • 使缓存无效/重新启动然后清理并重建项目

关于android - :app:mergeDebugResources FAILED Error: java. util.concurrent.ExecutionException : com. android.builder.internal.aapt.AaptException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47272220/

相关文章:

android - Corona SDK gotoScene 错误

android - 如何添加 View 以叠加在 map 上?

android - 具有相同的gradle级别仍然会通过更新google-services插件的版本引发修复版本冲突

docker - 在 Kubernetes pod 中为 docker-in-docker 容器使用 hosts 文件

java - Gradle & Groovy - 错误 : Could not find or load main class

java - Android 中仅客户端套接字编程

encryption - Jenkins 解密 API token

shell - 如何从 Jenkins 的 Groovy 中抓取文件系统上的文件

android - 如何在 Android Studio 中将 android API 26 更改为 29+?

hibernate - 使用插件 dsl 语法应用 hibernate-gradle-plugin?