简体   繁体   中英

Error building android project with gradle using teamcity

Using team city to build and android app. keep getting an error.

[16:59:38] [Step 1/1] Execution failed for task ':app:mergeDebugResources'. org.gradle.internal.UncheckedException: 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-28.0.0.aar\\3467ebf6f9d1bb66db4bdb226db55512\\res\\drawable-hdpi-v4\\abc_ic_menu_share_mtrl_alpha.png: error: file not found.

Command: C:\\Windows\\System32\\config\\systemprofile.gradle\\caches\\transforms-1\\files-1.1\\aapt2-3.2.1-4818971-windows.jar\\8a1ce91548f2547bb27874a553d3981d\\aapt2-3.2.1-4818971-windows\\aapt2.exe compile --no-crunch \\ --legacy \\ -o \\ C:\\TeamCity\\buildAgent\\work\\7028d0f31da34ed0\\Workshop\\app\\build\\intermediates\\res\\merged\\debug \\ C:\\Windows\\System32\\config\\systemprofile.gradle\\caches\\transforms-1\\files-1.1\\appcompat-v7-28.0.0.aar\\3467ebf6f9d1bb66db4bdb226db55512\\res\\drawable-hdpi-v4\\abc_ic_menu_share_mtrl_alpha.png Daemon: AAPT2 aapt2-3.2.1-4818971-windows Daemon #1

The file it says it can't find is definitely there. I'm a .net developer with hardly any experience of android development so I have no idea what to look at next in order to fix this. please help.

AAPT2 still seems to have some trouble with long paths on Windows. Try moving your gradle cache closer to C:\\ to shorten the file path.

Here's an answer on how to change the cache location: How to set gradle cache location?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM