One, Compile exemption description

A new requirement this morning, pull a new branch, and also then income to Android Studio, climate compiling error, as presented below:

*

The error details log is presented below:

Information:Gradle jobs <:app:assembleDebug>Error:Failed come crunch record C:\Code\XTC_NetEaseCloudMusic\branches\APP_NetEaseCloudMusic_UseByAnonymous\NetEaseCloudeMusic\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\25.2.0\res\drawable-xhdpi-v4\abc_textfield_search_activated_mtrl_alpha.9.png right into C:\Code\XTC_NetEaseCloudMusic\branches\APP_NetEaseCloudMusic_UseByAnonymous\NetEaseCloudeMusic\app\build\intermediates\res\merged\debug\drawable-xhdpi-v4\abc_textfield_search_activated_mtrl_alpha.9.pngError:Execution failure for task ':app:mergeDebugResources'.> Error: Failed come crunch file C:\Code\XTC_NetEaseCloudMusic\branches\APP_NetEaseCloudMusic_UseByAnonymous\NetEaseCloudeMusic\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\25.2.0\res\drawable-xhdpi-v4\abc_textfield_search_activated_mtrl_alpha.9.png into C:\Code\XTC_NetEaseCloudMusic\branches\APP_NetEaseCloudMusic_UseByAnonymous\NetEaseCloudeMusic\app\build\intermediates\res\merged\debug\drawable-xhdpi-v4\abc_textfield_search_activated_mtrl_alpha.9.pngInformation:BUILD FAILEDInformation:Total time: 2.682 secsInformation:2 errorsInformation:0 warningsInformation:See complete output in console

*

Error: Failed to crunch document C:\Code\XTC_NetEaseCloudMusic\branches\APP_NetEaseCloudMusic_UseByAnonymous\NetEaseCloudeMusic\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\25.2.0\res\drawable-xhdpi-v4\abc_textfield_search_activated_mtrl_alpha.9.png right into C:\Code\XTC_NetEaseCloudMusic\branches\APP_NetEaseCloudMusic_UseByAnonymous\NetEaseCloudeMusic\app\build\intermediates\res\merged\debug\drawable-xhdpi-v4\abc_textfield_search_activated_mtrl_alpha.9.png:app:mergeDebugResources FAILEDFAILURE: construct failed through an exception.* What went wrong:Execution failure for task ':app:mergeDebugResources'.> Error: Failed come crunch record C:\Code\XTC_NetEaseCloudMusic\branches\APP_NetEaseCloudMusic_UseByAnonymous\NetEaseCloudeMusic\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\25.2.0\res\drawable-xhdpi-v4\abc_textfield_search_activated_mtrl_alpha.9.png into C:\Code\XTC_NetEaseCloudMusic\branches\APP_NetEaseCloudMusic_UseByAnonymous\NetEaseCloudeMusic\app\build\intermediates\res\merged\debug\drawable-xhdpi-v4\abc_textfield_search_activated_mtrl_alpha.9.png* Try:Run with --stacktrace option to acquire the ridge trace. Run with --info or --debug alternative to get much more log output.BUILD FAILEDTotal time: 6.359 secsExecuting tasks: <:app:assembleDebug>

Two, systems of this exception

The reason for the not successful compilation is the it above the maximum directory length limit.

You are watching: Android studio failed to crunch file

Solution 1

Add the adhering to content right into build.gradle in the root directory

buildDir = "C:/tmp/$rootProject.name/$project.name"

*

The code way specifying the the magazine for task build result to store

The comparison is as follows:The code prior to modification:

allprojects repositories jcenter() mavenLocal()

*

The code after modification:

allprojects repositories jcenter() mavenLocal() buildDir = "C:/tmp/$rootProject.name/$project.name"After modification, deserve to compile and run successfully.

*

Solution 2 (Recommended)

Move the project to the outermost folder.

Re-checkout the branch code from the SVN server come this directory

C:\Code\APP_NetEaseCloudMusic_UseByAnonymous\NetEaseCloudeMusic

*

Then import into the Android Studio come compile, compile successfully and run successfully.

See more: Convert 60 Kg In Pounds And Stone, What Is 60Kg In Stone

To compare, the previous catalog is

C:\Code\XTC_NetEaseCloudMusic\branches\APP_NetEaseCloudMusic_UseByAnonymous\NetEaseCloudeMusicThe brochure is too lengthy to reason the compilation come fail

*

C:\Code\XTC_NetEaseCloudMusic\branches\APP_NetEaseCloudMusic_UseByAnonymous\NetEaseCloudeMusic\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\25.2.0\res\drawable-xhdpi-v4\abc_textfield_search_activated_mtrl_alpha.9.pngBecause abc_textfield_search_activated_mtrl_alpha.9.png'spathname has a full of 241 characters, more than the 240 personalities specified through windows. There could be hints:

Error: file path too long on windows, keep listed below 240 characters

The complying with is the paper directory border for the home windows system

*

After document path was shorten, translate in successfully, as presented below:

*

Three, summary

The last reason is due to the fact that the paper directory is as well long, so the is encourage to usage the an approach of 2, the project magazine will it is in shortened and also then imported right into the Android Studio come compile.

Reference document:

http://stackoverflow.com/questions/33905687/error-file-path-too-long-on-windows-keep-below-240-characters