当我运行 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/