I have been trying to build an Android application using Jenkins. I am getting Jenkins Execution failed for task :app:mergeDebugResources. I do have admin privilege but console output saying file not found. I have attached console output for reference. Please help.
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-28.0.0-alpha3.aar\6bb4f54973fdd09ea38bd7415ec1d0d5\res\layout\abc_action_bar_up_container.xml: error: file not found.
Command: C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.0-alpha11-4662957-windows.jar\67f4bb4ae3aea8a18831d06eb5615105\aapt2-3.2.0-alpha11-4662957-windows\aapt2.exe compile --legacy \
-o \
C:\Program Files (x86)\Jenkins\workspace\haha\app\build\intermediates\res\merged\debug \
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0-alpha3.aar\6bb4f54973fdd09ea38bd7415ec1d0d5\res\layout\abc_action_bar_up_container.xml
Fix by not using System32 as a cache. From this question there are two solutions to this:
Set the GRADLE_USER_HOME environmental variable
Add -g C:\*some dir* to the command
Facing this issue with Jenkins in windows, I fixed this issue by setting Environmental variable to Gradle as fixed my issue.
GRADLE_USER_HOME as C:/gradle-cache
Related
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
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.
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?
I use react-native-smart-splash-screen and install completely (do all task in docs).
and its work in the android emulator.
i install gradle-4-10-2 and in ./android folder in my project run this command $> ./gradlew assembleRelease
but get this erors:
What went wrong:
Execution failed for task ':react-native-smart-splashscreen:verifyReleaseResources'.
com.android.ide.common.process.ProcessException: Failed to execute aapt
I use the react-native link but also not work
how can fix it and build .apk file
Firstly, ensure Generated Signed APK . If error still exists, try add this line in your project gradle.properties file:
android.enableAapt2=false
After I clone from gitlab a react-native project
npm install
react-native run-android
add --stacktrace
But I do have build tool 23.0.1. How can I fix it?
ADB configuration may be missing
MyComputer-Properties-Advances System Settings-System Properties-Environment Variable - User variable
here add path to tool inside android SDK
pathto SDK/platform-tools
In the screenshot when you ran with --stacktrace you can actually see the error:
Cannot run program: "/home/ljh/work/software/Sdk/build-tools/23.0.1/aapt"
and then the error in Chinese saying:
"No file or directory"
Make sure the file /home/ljh/work/software/Sdk/build-tools/23.0.1/aapt actually exists, or if it does, try to execute it by hand form that directory ("$ aapt package -h") to see if an anti-virus isn't blocking it.
I cannot run any project. I created a default project with an acitivity and when i try to run it I get this error.
Error:Execution failed for task ':app:dexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
C:\androidstudio\sdk\build-tools\android-4.4W\dx.bat --dex --num-threads=4 --output C:\projects\app\build\intermediates\dex\debug C:\projects\app\build\intermediates\classes\debug C:\projects\app\build\intermediates\dependency-cache\debug
Error Code:
1
Output:
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
any dependency it tries to copy to dex/debug im guessing, but fails to do so.
Any ideas?
First of all, you should double check that the path C:\androidstudio\sdk\build-tools\android-4.4W\dx.bat does indeed exist. It could be that your SDK configuration is pointing at an invalid directory (though that's unlikely, given how far you're getting in the compilation/build process).
After that, this looks very similar to a similar error on OSX, so you might try the proposed solution there, which is to run gradlew.bat --stop using the Gradle wrapper script that should be in the root of your project and then try to compile again.