尝试运行命令时 ionic cordova run android
,最后出现以下错误:
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=C:\Android\android-sdk (recommended setting)
ANDROID_HOME=undefined (DEPRECATED)
Failed to run "javac -version", make sure that you have a JDK version 8 installed.
You can get it from the following location:
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Your JAVA_HOME is invalid: C:\Program Files\Java\jdk1.8.0_271
[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.
当我查找其他有此错误的人时,问题似乎是他们没有安装jdk或者他们的路径变量不正确。但是,我安装了正确版本的jdk,并且设置了path和javau home变量。
路径: C:\Program Files\Java\jdk1.8.0_271\bin
java\u主页: C:\Program Files\Java\jdk1.8.0_271
我在以下位置安装了jdk:
C:\Program Files\Java\jdk1.8.0_271
在我看来,path和javau home变量设置正确。有人知道是什么导致了这个错误吗?
暂无答案!
目前还没有任何答案,快来回答吧!