nativescript-cli icon indicating copy to clipboard operation
nativescript-cli copied to clipboard

Build failure for helloworld project on nativescript.org

Open sancteor opened this issue 10 years ago • 16 comments

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. (C:\Users\hedgehog\AppData\Roaming\npm\node_modules\nativescript\lib\common\child-process.js:91:38) at emitTwo (events.js:87:13) at ChildProcess.emit (events.js:172:7) at maybeClose (internal/child_process.js:827:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)

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.

sancteor avatar Jun 10 '16 17:06 sancteor

Hi, Try Installing Google Repository & Android Support Repository Img Reference

kiramishima avatar Jun 11 '16 19:06 kiramishima

Thanks for your help! Kiramishima! but still not working. Orz Same error as above

sancteor avatar Jun 12 '16 12:06 sancteor

Hey @sancteor,

Can you build normal Android projects using Android Studio? It seems that Android SDK is corrupted - you may need to reinstall it.

enchev avatar Jun 13 '16 06:06 enchev

Thank for your reply @enchev, Yes, I can. My old project still work. And new simple project is working too.

sancteor avatar Jun 13 '16 14:06 sancteor

In this case, as far as I understand, you are all set now?

enchev avatar Jun 14 '16 06:06 enchev

@enchev, Yes! but I don't know why I still got errors.

sancteor avatar Jun 14 '16 14:06 sancteor

Hey @slavchev @Plamen5kov @blagoev do yo know why the build is failing here?

enchev avatar Jun 16 '16 08:06 enchev

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.

sancteor avatar Jun 16 '16 08:06 sancteor

Hi @sancteor Couldn't reproduce the problem, I did:

  • git clone https://github.com/NativeScript/sample-Groceries.git
  • cd sample-Groceries
  • git checkout angular-start
  • tns run android

Plamen5kov avatar Jun 16 '16 11:06 Plamen5kov

@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.

sancteor avatar Jun 17 '16 16:06 sancteor

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 avatar Sep 01 '16 12:09 usurapong

@usurapong please provide steps to reproduce and I'll try and help.

Plamen5kov avatar Sep 01 '16 13:09 Plamen5kov

@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 avatar Sep 02 '16 01:09 usurapong

@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. :)

sancteor avatar Sep 02 '16 03:09 sancteor

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 avatar Jan 03 '17 14:01 siteslave

@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.

Plamen5kov avatar Jan 06 '17 07:01 Plamen5kov