无法在 IONIC 项目中运行 cordova run android? [英] Unable to run cordova run android in IONIC project?

查看:49
本文介绍了无法在 IONIC 项目中运行 cordova run android?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Mac 中安装了 ionic 并使用

I installed ionic in my Mac and created project using

$ ionic 启动 MyIonicProject 教程

$ ionic start MyIonicProject tutorial

现在我跑

$ cd MyIonicProject
$ ionic serve

现在它在浏览器中成功服务工作正常.所以我想在 android mobile 中看到相同的内容,所以尝试使用以下命令,

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

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 run android?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆