Android 使用Jenkins自动化打包报错
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Android 使用Jenkins自动化打包报错相关的知识,希望对你有一定的参考价值。
参考技术A 软件环境Window 7 x64
Jenkins jenkins-2.121.2
Tomcat 9.0.8
Android studio 3.1.2
Java JDK 1.8
Gradle 4.4
报错信息:
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.0.2.aar\648d88cb55d42908b7f13e3cf39f35e4\res\color\abc_secondary_text_material_dark.xml: error: file not found.C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\picture_library-v2.0.1.aar\f2ffe59924c8d15a99121bd8efdc1525\res\drawable\btn_left_true.xml: error: file not found.Error: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error: check logs for details: app:mergeGooglePlayDebugResources FAILEDFAILURE: Build failed with an exception.* What went wrong:Execution failed for task ':app:mergeGooglePlayDebugResources'.> Error: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error: check logs for details* Try:Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
解决方法:
设置环境变量: GRADLE_USER_HOME c:/gradle-cache
或者 gradle assembleDebug -g C:\gradle-cache
以上是关于Android 使用Jenkins自动化打包报错的主要内容,如果未能解决你的问题,请参考以下文章
Jenkins+Gradle+Github实现Android自动化打包
Ubuntu使用Jenkins配置自动化打包Android APK