Jenkins在运行gradlew assembleDebug
时返回以下错误。
在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/
答案 0 :(得分:4)
您是否单独应用这些操作?
在Windows上:
gradlew cleanBuildCache
在Mac或Linux上:
./gradlew cleanBuildCache
转到gradle.properties文件,并禁用构建缓存。
//重新启用 构建缓存,删除以下
//行或设置 财产到'真'。
android.enableBuildCache = false另一种方式是 通过添加第一行修改构建缓存目录可以跳过,因为 true是默认值2.3
android.enableBuildCache=true
android.buildCacheDir =c:\temp\
使缓存无效/重新启动,然后清理并重建项目