无法在IONIC项目中运行cordova运行android? [英] Unable to run cordova run android in IONIC project?
问题描述
我在Mac上安装了离子并使用
I installed ionic in my Mac and created project using
$ ionic start MyIonicProject教程
$ ionic start MyIonicProject tutorial
现在我运行
$ cd MyIonicProject
$ ionic serve
现在它已成功在浏览器中正常运行。所以我想在android手机中看到同样的东西,所以尝试使用下面的命令,
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,
离子cordova运行android --prod --release
ionic cordova run android --prod --release
这是一个非常简洁的问题,我无法纠正我的OSX错误,下面是我在上面运行的问题Mac ..
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
请帮助我解决在Android上运行IONIC项目时如何纠正这些错误。
Please help me someone on how to rectify these error when running the IONIC project on Android natively.
谢谢,
推荐答案
我遇到了类似的问题。我必须在android平台gradle中设置可执行权限。更正:它实际上是android gradle安装中的可执行权限。这似乎是一个报道的问题这里和cordova中的实际问题跟踪此处。
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.
运行命令:
chmod -R +x <location_of_android_studo>/gradle/gradle-<version>/bin
注意: -R
将运行从给定目录递归地命令。
NOTE: -R
will run the command recursively from the given directory.
这篇关于无法在IONIC项目中运行cordova运行android?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!