1
votes

I'm using Jenkins to build my android application. I have an issue with Aapt2 when I'm trying to build task "assemble".
I have added the android.enableAapt2 = true but I still have the issue.

Error :

Execution failed for task ':app:mergeDebugResources'.
> java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource compilation failed
  Output:  C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar\9b13819df5a46cfa71ada9be5d91c322\res\layout\abc_search_dropdown_item_icons_2line.xml: error: file not found.

  Command: C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\bc9c8887a50f76d929803eb5bfe61459\aapt2-3.2.1-4818971-windows\aapt2.exe compile --legacy \
          -o \
          D:\jenkins\workspace\DemoProject\app\build\intermediates\res\merged\debug \
          C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar\9b13819df5a46cfa71ada9be5d91c322\res\layout\abc_search_dropdown_item_icons_2line.xml
  Daemon:  AAPT2 aapt2-3.2.1-4818971-windows Daemon #2
1
What issue do you have? Is there any error shown?Sergey Glotov
I haved add the log error. The issue is with the task app:mergeDebugResourcesYounes Ben Tlili
I have resolve the issue by creating a new env. var GRADLE_USER_HOME. It is used to update the path of gradle cache.Younes Ben Tlili

1 Answers

0
votes

Looks like aapt2 is having trouble parsing the file path (it's too long). You can either try upgrading to the newest android gradle plugin which has better support for long paths, or you can try moving your gradle cache closer to the C: root.