Reputation: 1742
I have been trying to do CI using Jenkins for my Android application. I am new to this. After following some of the tutorials, I am able to atleast set up and run the build now option. It download every pom required but while building it give below error.
============================================ C:\Windows\System32\config\systemprofile.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar\e796469c387c11565d873216f24c3b6f\res\drawable\abc_ic_go_search_api_material.xml: error: file not found. C:\Windows\System32\config\systemprofile.gradle\caches\transforms-1\files-1.1\play-services-base-15.0.1.aar\7207fbd3bdb6cb696445cfc77c16e5ed\res\drawable-hdpi-v4\googleg_standard_color_18.png: error: file not found. C:\Windows\System32\config\systemprofile.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar\e796469c387c11565d873216f24c3b6f\res\layout\select_dialog_singlechoice_material.xml: error: file not found. Error: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error: check logs for details :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.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.
======================================================
Can you please let me know how to resolve it? Do let me know if anything else is required.
Upvotes: 0
Views: 1772
Reputation: 1
When using Jenkins with Window to build Android, I face this problem myself. I fix by add GRADLE_USER_HOME to Environment Variable:
GRADLE_USER_HOME = C:\Users\*MyUserName*\.gradle
hope this help,
Upvotes: 0
Reputation: 73
Maybe the path is too long. Try this:
Jenkins --> Project --> Project Configuration --> Build
Select advanced option
Check the option box "Force GRADLE_USER_HOME to use workspace"
I solved my problem by this way, good luck!
Upvotes: 2
Reputation: 352
you can solve this by separating into smaller group of task make separate invoke gradle script under build tab
i had similar issues, when i ran assembleDebug and test together in Jenkins as a single task
Upvotes: 0
Reputation: 7532
Try updating your android gradle plugin version to 3.2.0-alpha12 or newer. AAPT2's version included in these versions contains many fixes for path support on Windows which resulted in similar errors.
Upvotes: 0