Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to crunch file - Android studio (app:mergeDebugResources)

i am currentyl trying to implement Google ActivityRecognitionApi. However i get following errors:

Error:Failed to crunch file C:\Users\marschall\Desktop\googlesamples-android-play-location-2ed2964\ActivityProject\app\build\intermediates\exploded-aar\com.google.android.gms\play-services-cast-framework\10.0.1\res\drawable-xxhdpi-v4\quantum_ic_forward_30_grey600_36.png into C:\Users\marschall\Desktop\googlesamples-android-play-location-2ed2964\ActivityProject\app\build\intermediates\res\merged\debug\drawable-xxhdpi-v4\quantum_ic_forward_30_grey600_36.png

Error:Execution failed for task ':app:mergeDebugResources'. Error: Failed to crunch file C:\Users\marschall\Desktop\googlesamples-android-play-location-2ed2964\ActivityProject\app\build\intermediates\exploded-aar\com.google.android.gms\play-services-cast-framework\10.0.1\res\drawable-xxhdpi-v4\quantum_ic_forward_30_grey600_36.png into C:\Users\marschall\Desktop\googlesamples-android-play-location-2ed2964\ActivityProject\app\build\intermediates\res\merged\debug\drawable-xxhdpi-v4\quantum_ic_forward_30_grey600_36.png

I am very new to Android developement and really dont know what to do.

I appreciate any comments.

Thanks in advance

EDIT: My mistake! Forgot to copy some files...

like image 340
Tobias Marschall Avatar asked Dec 21 '16 15:12

Tobias Marschall


3 Answers

Failed to crunch file means studio can't process the file. Its too long and it has reached the max file path line of the operating system.

-> Crude way to solve it is move the project to some folder in "C:\".

-> Better way is to change the build directory of the project in the build.gradle file (Project)

allprojects {
    buildDir = "C:/tmp/${rootProject.name}/${project.name}"
    .
    .
}
like image 125
mavHarsha Avatar answered Nov 19 '22 14:11

mavHarsha


this is because your project path is too long. Please make this as short as possible. It will resolve this error.

Like

C:\Users\marschall\Desktop\googlesamples-android-play-location-2ed2964\ActivityProject

to

C:\ActivityProject

like image 27
rajeesh Avatar answered Nov 19 '22 15:11

rajeesh


The length of the path\file name (the count of all characters in the name)has crossed the maximum limit. This is happening because a combination of length of file name and the multiple nested folder levels.

like image 8
Prasad Nageshkar Avatar answered Nov 19 '22 14:11

Prasad Nageshkar