I am building an adroid project using clean assemble command on Jenkins.
My build is failing each time I run showing this error. Can anyone help me or tell me how can I resolve error related to app: and proguard.
Here is the part of log that shows error.
Error: Some file crunching failed, see logs for details
:app:mergeClient_flavourDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeClient_flavourDebugResources'.
> Error: Some file crunching failed, see logs for details
You must be using some resource with unsupported characters in the file name. Check the names of your files in res folder of your project.
It can also happen sometimes if you are using 9-patch image in your project.
If you are using 9-patch image in the project then modify that image slightly with 9-patch editor of android studio and then try to build project.
Related
How to solve the error "failed to crunch file"
Error:Execution failed for task ':app:mergeDebugResources'.
Error: Failed to crunch file FinalProject\app\build\intermediates\exploded-aar\com.google.android.gms\play-services-base\10.2.1\res\drawable-xxhdpi-v4\common_google_signin_btn_icon_light_normal_background.9.png into FinalProject\app\build\intermediates\res\merged\debug\drawable-xxhdpi-v4\common_google_signin_btn_icon_light_normal_background.9.png
I had exactly the same error, when I was using the google plus plugin. I tried to move the project to a smaller path and it worked.
Searching a bit more about it, it seems that Google has a 240 characters size limitation to the path.
Another possible solution, is to add to your platforms/android/build.gradle, inside allprojects, this line:
buildDir = "C:/tmp/${rootProject.name}/${project.name}"
Now your build file will be moved to a smaller path and the problem will disappear.
Please change path of your project folder previous path have to long
Example d:projects/tfs/demos/ionic/projects/project_Name to projects/project_name folder
or
by using "subst" command in command prompt like below
d:projects/tfs/demos/ionic/projects/project_Name folder :subst i: . it will make "i" drive in PC, "i" drive open your project and build it
I get this following error when syncing android project with gradle:
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
What does it mean? How do I fix it?
processDebugResources = You have resources (xml files, layouts, images, etc) that have errors or simply need rebuilt.
Cleaning the project may fix the error, but if not, there is often the actual error message within the Gradle console that tells which resource is the problem.
So, the solution to fixing it is usually to read what the full error says, not just the root exception.
First Clean Project and check that you have the latest build tools.(make sure to update support libraries to your current build tool version)
If error still exists Check if you added a resource that violates the conventions.
E.g. cannot have capital letters and such. eg : file_name.PNG
Or may be you rename a resource folder.In that case clear caches and restart!
I run an Android Studio v2.1.3 and use ./gradlew build to detect errors in the Android project with the Findbags.
Recently an error started to come up:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':process:customFindbugs'.
> java.io.IOException: No files to analyze could be opened
There are enough disk space and RAM and beside that I don't see any particular reason for that error to occur. Please help to elaborate on this problem.
If you use 3.2, please take a note that
classes = files("$project.buildDir/intermediates/classes")
should be
classes = files("$project.buildDir/intermediates/javac")
I had the same problem after reorganizing my gradle files.
This is the actual command:
gradlew --stacktrace assemble findbugs
Accidentally, I did this:
gradlew --stacktrace findbugs
With the first command no error arises, with later it shows "java.io.IOException: No files to analyze could be opened".
To cut a long story short, maybe your files weren't compiled (yet).
I am not able to figure out why this error is coming
Here is full error
Error:Execution failed for task
':app:transformClassesWithMultidexlistForDebugAndroidTest'.
> java.io.IOException: The output jar is empty. Did you specify the proper
'-keep' options?
My gradle android project was not having "androidTest" so I created manually and test folder here is screenshot of folder structure
I would not consider it as perfect answer but this is what i did.
I removed testInstrumentationRunner="android.support.test.runner....." from build.gradle file and restarted
It starts working :)
It is just for information
I am having trouble with getting rid of the error Cannot resolve symbol 'R'. I have done some research but none has worked. Among the tips i have tried out include Tools->Android->Sync Project with Gradle Files after which I executed the Build->Clean Project. The clean project command resulted with the following error;
Execution failed for task ':app:mergeDebugResources'. > Crunching Cruncher abc_btn_radio_to_on_mtrl_000.png failed
My xml files have the following error:
NOTE: This project contains Java compilation errors, which can cause rendering failures for custom views. Fix compilation problems first
Exception raised during rendering: action_bar
What might I be missing? I will appreciate any help or pointers.
In the comments above, #Udit posted a link to another sort of related question from which I was able to get a solution. Incase you run into a similar problem, the solution is quite simple. Reboot Android Studio and then go to Build->Rebuild Project. Hope this will sort out your issue as it did mine. Thank you all for your contribution.
Execution failed for task ':app:mergeDebugResources'. > Crunching
Cruncher abc_btn_radio_to_on_mtrl_000.png failed
--->Is this error message from the gradle console?
Because this happened to me once when the PNG file I used wasn't a "pure" PNG file. Like for example: An image I found from the internet that wasn't really a PNG file(ex: jpg/Gif image) but I just renamed it to to a ".PNG" file upon saving it then directly copied this to res/drawable. So to fix this I deleted the image and used a real PNG file by either editing it on Photoshop or a real png file from the internet or whatever and then did #Biko's advice which was to Reboot Android Studio and then go to Build->Rebuild Project.