繁体   English   中英

Ionic 4 在设备上运行:“在 Android Studio 或系统中找不到 Gradle 的安装版本”虽然我的系统上有它

[英]Ionic 4 Running on Device: “Could not find an installed version of Gradle either on Android Studio or in System” Although I have it on my system

我正在尝试在我的 android 9 设备上运行 ionic 4 的空白应用程序。 已经按照网站上的每个步骤操作并在浏览器上运行它是可以的。 When I run it on my device here is what i get: Error when running It says I dont have gradle and android studio but here is my environment: android sdk list , my /etc/environment , and my npm, ionic, gradle and java版本我错过了什么吗?

您的问题不清楚,您是否在本地模拟器或真实移动设备上遇到错误? 看来您正在尝试在本地 android 仿真器上运行,您能否提一下您遇到错误的地方? Also, if possible do debug or production build with the help of 'ionic cordova build android' command and try to run on your android device, generally android studio will pops up of gradle build update, which will help to generate faster sequential android build,并且需要 gradle 。

当 gradle 未正确安装时会出现此错误。 我以前经历过这种情况。 尝试在您的系统上安装 gradle。

出于某种原因,离子项目找不到 gradle,要验证是否是这种情况,请尝试在 android 工作室打开项目,您将收到未找到 gradle 包装器的警告。

IDK 如果你们中的一些人有同样的问题,但这是因为 Gradle。 按照网站所说的方式安装它,使用 SDK 管理器自动尝试以及手动下载。 仍然没有。 所以我安装它使用:

sudo add-apt-repository ppa:cwchien/gradle

sudo apt-get 更新

sudo apt-get install gradle

然后找到它的安装位置,然后添加到路径。 现在我可以在我的设备上安装应用程序

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM