:mergeDebugResources'. > Error: Failed to crunch file

Yesterday I could compile my project without problem (didn’t move directories or so).

Today, I got an update message from Ionic to update several things.

Now I get this.

Execution failed for task ':mergeDebugResources'.
> Error: Failed to crunch file D:\Sync\Martin\inProgress\LOP\test-scan\repos\suntrack-scan\platforms\android\build\intermediates\exploded-aar\com.google.android.gms\play-services-base\11.0.0\res\drawable-xxhdpi-v4\common_google_signin_btn_icon_light_normal_background.9.png into D:\Sync\Martin\inProgress\LOP\tes-scan\repos\suntrack-scan\platfo
rms\android\build\intermediates\res\merged\debug\drawable-xxhdpi-v4\common_google_signin_btn_icon_light_normal_background.9.png

So I doubt it is because of long directories…

Any other fix I can apply?

Thanks,

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.

10 Likes

yes, changing long of directory path works

Thanks a lot guys this solution worked.

Make you path small For example test/project/source/… change it to t/p/source…
It will work