Build failure for helloworld project on nativescript.org
I setup the environment as instructed by the page: http://docs.nativescript.org/angular/start/ns-setup-win And then I try to build the hello world project on nativescript.org: http://docs.nativescript.org/angular/tutorial/ng-chapter-1. But I was given the error below:
:preBuild UP-TO-DATE :preF0DebugBuild UP-TO-DATE :checkF0DebugManifest :preF0ReleaseBuild UP-TO-DATE :prepareComAndroidSupportAnimatedVectorDrawable2340Library FAILED FAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ':prepareComAndroidSupportAnimatedVectorDrawable2340Library'.
Could not expand ZIP 'E:\Android\sdk\extras\android\m2repository\com\android\support\animated-vector-drawable\23.4.0\animated-vector-drawable-23.4.0.aar'.
The output of $tns build android --log trace is
Total time: 11.236 secs
Error: Command F:\project\test\sample-Groceries\platforms\android\gradlew.bat failed with exit code 1
at FiberFuture.Future.wait (C:\Users\hedgehog\AppData\Roaming\npm\node_modules\nativescript\node_modules\fibers\future.js:535:15)
at C:\Users\hedgehog\AppData\Roaming\npm\node_modules\nativescript\lib\common\errors.js:123:33
at Function.settle (C:\Users\hedgehog\AppData\Roaming\npm\node_modules\nativescript\node_modules\fibers\future.js:249:26)
at FiberFuture.Future.wait (C:\Users\hedgehog\AppData\Roaming\npm\node_modules\nativescript\node_modules\fibers\future.js:534:10)
at C:\Users\hedgehog\AppData\Roaming\npm\node_modules\nativescript\lib\common\services\commands-service.js:84:106
at Function.settle (C:\Users\hedgehog\AppData\Roaming\npm\node_modules\nativescript\node_modules\fibers\future.js:249:26)
at FiberFuture.Future.wait (C:\Users\hedgehog\AppData\Roaming\npm\node_modules\nativescript\node_modules\fibers\future.js:534:10)
at C:\Users\hedgehog\AppData\Roaming\npm\node_modules\nativescript\lib\common\yok.js:208:124
at Function.settle (C:\Users\hedgehog\AppData\Roaming\npm\node_modules\nativescript\node_modules\fibers\future.js:249:26)
at FiberFuture.Future.wait (C:\Users\hedgehog\AppData\Roaming\npm\node_modules\nativescript\node_modules\fibers\future.js:534:10)
at C:\Users\hedgehog\AppData\Roaming\npm\node_modules\nativescript\l`ib\common\services\commands-service.js:51:55
at Function.settle (C:\Users\hedgehog\AppData\Roaming\npm\node_modules\nativescript\node_modules\fibers\future.js:249:26)
at FiberFuture.Future.wait (C:\Users\hedgehog\AppData\Roaming\npm\node_modules\nativescript\node_modules\fibers\future.js:534:10)
at C:\Users\hedgehog\AppData\Roaming\npm\node_modules\nativescript\lib\common\errors.js:123:33
at Function.settle (C:\Users\hedgehog\AppData\Roaming\npm\node_modules\nativescript\node_modules\fibers\future.js:249:26)
at FiberFuture.Future.wait (C:\Users\hedgehog\AppData\Roaming\npm\node_modules\nativescript\node_modules\fibers\future.js:534:10)
- - - - -
at ChildProcess.
My machine (x64) has 4.00 GB of RAM and 3.86 GB is usable Node 4.4.5 Java 1.8.0_91
Any ideas? Thank you so much! I've been stuck for a week.
Hi, Try Installing Google Repository & Android Support Repository Img Reference
Thanks for your help! Kiramishima! but still not working. Orz Same error as above
Hey @sancteor,
Can you build normal Android projects using Android Studio? It seems that Android SDK is corrupted - you may need to reinstall it.
Thank for your reply @enchev, Yes, I can. My old project still work. And new simple project is working too.
In this case, as far as I understand, you are all set now?
@enchev, Yes! but I don't know why I still got errors.
Hey @slavchev @Plamen5kov @blagoev do yo know why the build is failing here?
http://stackoverflow.com/questions/37621383/errorexecution-failed-for-task-mobilepreparecomandroidsupportanimatedvectord/37707867#37707867 This looks like mine. Another clue is in that I answered in this link. but that time I had wrong AVD configuration so I don't know if that succeeded or not.
Hi @sancteor Couldn't reproduce the problem, I did:
git clone https://github.com/NativeScript/sample-Groceries.gitcd sample-Groceriesgit checkout angular-starttns run android
@Plamen5kov Thanks! Today I tried it again. The result is, Running four lines of commands, First time is pretty good. The emulator started and appeared but it could not run the program. Then I only ran $tns run android, got that error again.
Let me share my case. I've been stuck with this error for three weeks. Trying to solve it with several methods i.e. update Android SDK, use older Gradle and NativeScript, copy all necessary files from a working PC, change attributes and permissions of project's and files' folders, update Windows to support long folder's path but none did work.
The only solution I accomplished for Windows is to set Region/Format (in Control Panel) to English (US) and that's all. Hope this could help.
@usurapong please provide steps to reproduce and I'll try and help.
@Plamen5kov Thank you. I've solved the problem.
BTW, to reproduce the error in Windows, I think you can just change the Region/Format of a PC to other language than English. Then build or run a project on Android platform. PS. I've also installed NativeScript on Mac OSX +Android but found none of this error.
@usurapong Oh. Thank you! After the issue was closed. I just had my new windows installation in one other pc. That pc had no error. I think it might like what you found. Thanks again. Now I can die peacefully. :)
I have a same problem:
- What went wrong: Execution failed for task ':prepareComAndroidSupportAnimatedVectorDrawable2340Library'.
Could not expand ZIP 'C:\Users\sites\AppData\Local\Android\android-sdk\extras\android\m2repository\com\android\support \animated-vector-drawable\23.4.0\animated-vector-drawable-23.4.0.aar'.
@siteslave, @sancteor you can look at this issue. I can't reproduce the problem, but it seems it might be related with the path length or the permissions you have on the machine.