Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.0k views
in Technique[技术] by (71.8m points)

java - Requirements check failed for JDK 8 ('1.8.*')! Detected version: null

I am trying to generate .apk file for my angular application.

To generate apk used -
cordova build android

after some process it generate error.

I have also set user variables and system variables
ANDROID_HOME = C:UsersuserAppDataLocalAndroidSdk
??JAVA_HOME = C:Program FilesJavajdk1.8.0_271
?????PATH = ...;C:Program FilesJavajdk1.8.0_271in;
?????????C:UsersuserAppDataLocalAndroidSdkools;
?????????C:UsersuserAppDataLocalAndroidSdkplatform-tools

echo %JAVA_HOME% is printing => C:Program FilesJavajdk1.8.0_271
java -version => java version "1.8.0_271"
???????Java(TM) SE Runtime Environment (build 1.8.0_271-b09)
???????Java HotSpot(TM) 64-Bit Server VM (build 25.271-b09, mixed mode)
gradle -v => Gradle 5.6.3
cordova -v => 9.0.0 (cordova-lib@9.0.1)
cordova platform version android => Installed platforms:
?????????????????android 9.0.0

Android Studio installed => 4.0.0

my error is

ANDROID_SDK_ROOT=undefined (recommended setting)
ANDROID_HOME=C:UsersuserAppDataLocalAndroidSdk (DEPRECATED)
Using Android SDK: C:UsersuserAppDataLocalAndroidSdk
Requirements check failed for JDK 8 ('1.8.*')! Detected version: null
Check your ANDROID_SDK_ROOT / JAVA_HOME / PATH environment variables

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

New versions have some issues so after downgrading gradle and android version, I have restarted my system and again folowing this steps worked for me-
https://medium.com/@christof.thalmann/convert-angular-project-to-android-apk-in-10-steps-c49e2fddd29

as I was trying to create apk for angular app.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...