android - Ionic cordova 构建 android 失败 - 由于某些路径错误

标签 android cordova ionic-framework

我创建了一个基于日常费用管理的 ionic 应用程序。我的应用程序的后端正在 firebase 上运行。现在,我想为我的应用程序生成一个 APK。我安装了 Cordova CLI 来构建 Android APK。 我使用像 ionic cordova platform add android 这样的命令在我的费用管理演示应用程序中添加 Android 平台。 现在我想构建一个 Android 应用程序,为此,我使用像 ionic cordova build android 这样的命令,但它给了我一个错误,错误就像,

> cordova.cmd build android
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=undefined (recommended setting)
ANDROID_HOME=C:\Users\radhika.thakkar\AppData\Local\Android\Sdk (DEPRECATED)
Could not find an installed version of Gradle either in Android Studio,
or on your system to install the gradle wrapper. Please include gradle
in your path, or install Android Studio
[ERROR] An error occurred while running subprocess cordova.

        cordova.cmd build android exited with exit code 1.

        Re-running this command with the --verbose flag may provide more information.

我尝试了很多不同的路径来设置 ANDROID_SDK_ROOT 和 ANDROID_HOME 但都失败了。 所以请帮我看看我应该怎么做才能为我的应用程序构建 Android apk。

最佳答案

使用电容器代替 Cordova 。 你需要在 android studio 中构建 gradle 文件。 转到 android studio 的工具部分,您可以看到构建,单击该

关于android - Ionic cordova 构建 android 失败 - 由于某些路径错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59242785/

相关文章:

javascript - Phonegap/Cordova 3.1 由于页面加载而重置插件

ionic-framework - 如何使用电容器重命名 ionic 中的平台 "App"

android - Ionic2 native : Hide location bar in android

java - 从 AsyncTask 返回 4 个列表

android - Google GCM - 在 android Lollipop 中没有收到推送通知

java - 为什么 DES 加密和 DESede 加密结果相同?

android - 继承自 AppCompat 工具栏更改工具栏图标边距

iphone - 同步调用 native 函数

image - Cordova android 无法从缓存目录复制图像

ios - xcode "The file couldn' t被打开”