简体   繁体   中英

Cordova CLI Android/gradle in Windows 10

While trying to publish my cordova app for android after an Android SDK update I am getting the error below.

I have set my environment variables as per below and I have the latest java sdk. I have tried downloading the latest gradle and set the environment variables to point to the extracted files and I tried the zipped files, and I have pointed it to an online service. Neither made a change.

Can someone explain the errors and point me in the right direction

ANDROID_SDK_ROOT=C:\\Users\\Johnathan\\AppData\\Local\\Android\\android-sdk (recommended setting) ANDROID_HOME=C:\\Users\\Johnathan\\AppData\\Local\\Android\\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:62) C:\\usb_webserver\\root\\cordova\\Sunpharma\\slate\\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.ja va:44) at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:107) at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:62)

The problem was that my gradle was still referencing the old installation. I had to manually remove the old installation before the computer would recognise the newer version even though the newer installation was fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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