Repository navigation
Description
Please, provide the details below:
I am following the example on {N} website but it fails to compile(http://docs.nativescript.org/angular/tutorial/ng-chapter-2#chapter-2creating-user-interfaces)
Error: Failed to crunch file C:\Users\Manu\Documents\manu\programs\nativescript\nativeAngular\groceries\Groceries\platforms\android\build\intermediates\exploded-aar\com.android.support\appcompat-v7\23.4.0\res\drawable-hdpi-v4\abc_textfield_search_default_mtrl_alpha.9.png into C:\Users\Manu\Documents\manu\programs\nativescript\nativeAngular\groceries\Groceries\platforms\android\build\intermediates\res\merged\F0\debug\drawable-hdpi-v4\abc_textfield_search_default_mtrl_alpha.9.png
:mergeF0DebugResources FAILED
FAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ':mergeF0DebugResources'.
Error: Failed to crunch file C:\Users\Manu\Documents\manu\programs\nativescript\nativeAngular\groceries\Groceries\platforms\android\build\intermediates\exploded-aar\com.android.support\appcompat-v7\23.4.0\res\drawable-hdpi-v4\abc_textfield_search_default_mtrl_alpha.9.png into C:\Users\Manu\Documents\manu\programs\nativescript\nativeAngular\groceries\Groceries\platforms\android\build\intermediates\res\merged\F0\debug\drawable-hdpi-v4\abc_textfield_search_default_mtrl_alpha.9.png
Did you verify this is a real problem by searching [Stack Overflow]
I checked this answer but it didn't solve the problem - https://stackoverflow.com/questions/37913740/nativescript-execution-failed-for-task-mergef0debugresources
Tell us about the problem
I am following the example on http://docs.nativescript.org/angular/tutorial/ng-chapter-2#chapter-2creating-user-interfaces on Windows machine. I get error > Error: Failed to crunch file C:\Users\Manu\Documents\manu\programs\nativescript\nativeAngular\groceries\Groceries\platforms\android\build\intermediates\exploded-aar\com.android.support\appcompat-v7\23.4.0\res\drawable-hdpi-v4\abc_textfield_search_default_mtrl_alpha.9.png into C:\Users\Manu\Documents\manu\programs\nativescript\nativeAngular\groceries\Groceries\platforms\android\build\intermediates\res\merged\F0\debug\drawable-hdpi-v4\abc_textfield_search_default_mtrl_alpha.9.png
I have checked that the path exists -
C:\Users\Manu\Documents\manu\programs\nativescript\nativeAngular\groceries\Groceries\platforms\android\build\intermediates\res\merged\F0\debug\drawable-hdpi-v4\
The console hangs with messsage - Unable to apply changes on device: 192.168.152.101:5555. Error is: Command gradlew.bat failed with exit code 1.
I am using geny emulator
Please provide the following version numbers that your issue occurs with:
tns version - 3.12
"tns-android": {"version": "3.1.1"}
Activity
manuchadha1979 commentedon Jul 22, 2017
solved the issue from this tip - https://stackoverflow.com/questions/41267005/failed-to-crunch-file-android-studio-appmergedebugresources
add to shorted the full path of the project
manuchadha1979 commentedon Jul 22, 2017
solved the issue from this tip - https://stackoverflow.com/questions/41267005/failed-to-crunch-file-android-studio-appmergedebugresourcesadd to shorted the full path of the project
unit-cesar commentedon Sep 12, 2017
The reason for this, on Windows, is the size of the path (max 248), after configuring the OS the commands work perfect for me.
"Starting in Windows 10, version 1607, MAX_PATH limitations have been removed..."
But you have to opt for it and enable long path to fix, see how:
//In Registry Editor navigate to the following key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
//Change
LongPathsEnabled = 0
//To
LongPathsEnabled = 1
If you don’t see the value listed, you’ll need to create it, choosing New > DWORD (32-bit) Value, and then naming the new value "LongPathsEnabled" and value "1".
More details and change by Local Group Policy Editor:
https://www.howtogeek.com/266621/how-to-make-windows-10-accept-file-paths-over-260-characters/
and...
https://mspoweruser.com/ntfs-260-character-windows-10/
_
About the Maximum File Path Length Limitation in Windows:
https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx