Unable to run cordova run android in IONIC project?

你离开我真会死。 提交于 2019-11-27 08:25:26

问题


I installed ionic in my Mac and created project using

$ ionic start MyIonicProject tutorial

Now i run

$ cd MyIonicProject
$ ionic serve

Now it is serving successfully in browser working fine. So I would like to see the same in android mobile so tried using the below command,

ionic cordova run android --prod --release

This is the pretty concise issue and i can't able to rectify my OSX error's below are the issues when i run above in my Mac..

 > cordova run android --release
ANDROID_HOME=/usr/local/Caskroom/android-sdk/3859397,26.0.2
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home
Error: spawn EACCES

[ERROR] An error occurred while running cordova run android --release (exit code 1).

[17:54:52]  lint finished in 2.69 s 

Please help me someone on how to rectify these error when running the IONIC project on Android natively.

Thanks,


回答1:


I had run into a similar issue.I had to set executable permissions in the android platform gradle. Correction: It was actually executable permissions in the android gradle installation. It seems to be a reported issue here and the actual issue in cordova is tracked here.

Run the command:

chmod -R +x <location_of_android_studo>/gradle/gradle-<version>/bin

NOTE: -R will run the command recursively from the given directory.



来源:https://stackoverflow.com/questions/47350780/unable-to-run-cordova-run-android-in-ionic-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!