gpt4 book ai didi

java - Cordova 与 Ionic 无法检测到 Java 或 Android Studio

转载 作者:行者123 更新时间:2023-12-01 18:06:31 25 4
gpt4 key购买 nike

我开始使用 ionic 和 cordova 并安装了 Android studio 我安装了所需版本的 jdk 并安装了 gradle,现在我在做某事时遇到了 3 个问题

$ ionic cordova build --release android

第一:

Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=undefined (recommended setting)
ANDROID_HOME=C:\Users\\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 --release exited with exit code 1.

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

第二个:

我不明白如何安装或安装 Android Studio,即使在手动设置 ANDROID_HOME 后,它也会出现在 Android Studio 中。

在Linux上,问题是他没有从头开始阅读Java,我在其他3个设备上尝试过,同样的问题不同的问题。

有时会出现错误,我必须安装操作系统才能构建。

- 说明性图片 -

Android Studio 控制台内部:

Inside Android Studio Console

从控制台 CMDER:

From Console CMDER

最佳答案

安装gradle后

> cordova.cmd build android --release
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=undefined (recommended setting)
ANDROID_HOME=C:\Users\mssma\AppData\Local\Android\sdk (DEPRECATED)
Subproject Path: CordovaLib
Subproject Path: app
Exception in thread "main" java.lang.NullPointerException
at org.gradle.wrapper.PathAssembler.getDistName(PathAssembler.java:84)
at org.gradle.wrapper.PathAssembler.getDistribution(PathAssembler.java:40)
at org.gradle.wrapper.Install.createDist(Install.java:44)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:107)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:63)
E:\D-Proj\Android\Salonproject\SalonApp\platforms\android\gradlew: Command failed with exit code 1 Error output:
Exception in thread "main" java.lang.NullPointerException
at org.gradle.wrapper.PathAssembler.getDistName(PathAssembler.java:84)
at org.gradle.wrapper.PathAssembler.getDistribution(PathAssembler.java:40)
at org.gradle.wrapper.Install.createDist(Install.java:44)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:107)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:63)
[ERROR] An error occurred while running subprocess cordova.

cordova.cmd build android --release exited with exit code 1.

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

关于java - Cordova 与 Ionic 无法检测到 Java 或 Android Studio,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60548443/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com