gpt4 book ai didi

android - ionic cordova构建android失败: Exception in thread "main" java. lang.NullPointerException

转载 作者:行者123 更新时间:2023-12-04 11:02:22 26 4
gpt4 key购买 nike

我正在 Ionic 上做一个应用程序。问题是当我想为 Android 编译时。它给了我一个错误。我已经尝试了很多东西,但它不起作用。我是这方面的新手,也许我做错了什么,所以这就是我寻求您帮助的原因。我会把所有的信息都放在这里,所以我希望你能帮助我。
我正在使用 Windows 10。这是终端向我显示的错误

    > cordova.cmd build android
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=C:\Users\cesal\AppData\Local\Android\Sdk (recommended setting)
ANDROID_HOME=C:\Program Files\Java\jdk1.8.0_231 (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)
D:\OneDrive\Documentos\Proyecto Fashioner\Aplicacion\fashioner-app\Fashioner\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 exited with exit code 1.

Re-running this command with the --verbose flag may provide more information.
我的 Ionic 的信息是这样的:
ionic info

Ionic:

Ionic CLI : 5.4.2 (C:\Users\cesal\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : @ionic/angular 4.10.0
@angular-devkit/build-angular : 0.801.3
@angular-devkit/schematics : 8.1.3
@angular/cli : 8.1.3
@ionic/angular-toolkit : 2.0.0

Cordova:

Cordova CLI : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : android 8.1.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.1.2, (and 7 other plugins)

Utility:

cordova-res : 0.8.1

System:

NodeJS : v10.16.0 (C:\Program Files\nodejs\node.exe)
npm : 6.11.3
OS : Windows 10
Cordova 的要求是:
cordova requirements

Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: installed true
Android target: installed android-29,android-28,android-27
Gradle: installed C:\Gradle\gradle-5.6.4\bin\gradle
所以,我不确定问题是否是系统的环境变量。我在不同的论坛上看到了添加,但它不起作用。这里有截图:
my environment variables
这是我的 PATH 变量:
PATH Variable
请帮帮我,我不知道如何处理这个问题。我希望你能帮助我。谢谢

最佳答案

我花了将近 2 天的时间来寻找解决方案
请在环境变量中删除它
希望它有效CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL

关于android - ionic cordova构建android失败: Exception in thread "main" java. lang.NullPointerException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58720403/

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