-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Requirements check failed for JDK 8 ('1.8.*')! Detected version: null #1040
Comments
This suggests you don't have a java JDK installed. If you do, you should ensure the |
I'm facing the same problem. I have everything configured, the weird is I started to get this issue only after restart my computer, during the installation of Android Studio/SDK and creating the Cordova app for the first time, worked fine. I'm looking for a solution, no success. I reinstalled everything: Android Studio, JDK, Cordova, but nothing... I have all these environment variables defined, but the Java version can't be detected by Cordova. If I run java -version, I get: java version "1.8.0_261" So, I have the Java installed! What is happening? What is the problem? |
For linux/mac try running:
For windows i think it's:
But I'm not familiar with windows shell programming, so I may be recalling incorrectly. If the shell prints out empty string/line, then you should set the Learn how via: https://cordova.apache.org/docs/en/latest/guide/platforms/android/index.html#setting-environment-variables |
Hi breautek, I have installed JDK and i have set JAVA_HOME variable in environment variable but still it is not working. Then I have found that some issue in check_req.js. I have changed code from After changed to the above code able to get java version and working fine. Can you please change to the above working code in check_req.js and commit. |
Master currently has https://github.com/apache/cordova-android/blob/master/bin/templates/cordova/lib/check_reqs.js#L211 and so does Are you sure you're up to date? Try using
|
Hi @breautek Please find my Cordova version below ``npm info cordova [email protected] | Apache-2.0 | deps: 13 | versions: 1314 keywords: cordova, client, cli bin: cordova dist dependencies: maintainers:
dist-tags: published a week ago by erisu [email protected]`` But I want to install [email protected] to get Android API level 29. When I install [email protected], i am getting the above error. So as of now i am changing the below code to work
|
This should only work if executing in shell mode. It doesn't follow the documentation of execa In general we refrain from using shell modes because it's slower, not cross-platform, and easy to introduce security vulnerabilities if care is not taken. Additionally I haven't been able to reproduce this using the latest versions of the software. The latest versions of cordova to date are: cordova 8.1.0 is an old and no longer maintained version. If you can reproduce your issue on cordova 10 / cordova-android@9, then do let me know. |
Hi everyone; I had the same problem on my Mac; after analyzing my package-lock.json; I had a version of execa:1.0.0 ! I don't know where it comes from. I removed my package-lock.json and the node_modules, then I did "npm i -D execa". Which will now be in 4.0.3. That solved my problem. |
@MatHackDev I think all you needed to do was remove the I also usually remove the |
Thanks for answer @erisu but "remove the package-lock.json & node_modules directory and run npm i" it's not working for me. But i will test "remove platforms and run cordova prepare." Maybe it's related to another package that creates a conflict. |
I experienced the same issue. I'm using CLI v9. Even if it does not make sense to me at all, deleting package-lock and node_modules and reinstalling did the trick. 😕 EDIT: I found the reason. Doing the "force npm modules upgrade" seems to force the update of execa dependency. The version that was being used was returning undefined when Cordova executed javac -version command to obtain the current JDK version. |
|
I think it's time to close this issue. The problem seems to be in the |
Hi, here is my contribution. I have exactly the same problem, after hours of research I think I have more information about this. Here is my dependency tree for
When there is different version of a library, npm create sub The version of I don't know why but when I execute Of course I did the classic "delete Thanks for your help! I'm on windows 10, cordova 10.0.0, cordova-android 9.0.0, npm 6.14.5, node 10.18.1 |
I think you should open a new issue and fill out the issue form documenting how That theory is because our executing code that depends on |
try downgrading the android version. it worked for I also faced the same problem |
I Deleted J 15 in library and started build and it started :) |
I had an issue similar to this, my version check failed because I am running with JDK 15.0. |
Android SDK & Android Gradle Plugin only officially supports Java 7 and 8. Last time I tested on anything higher, you could build but not all of the android tooling works on Java > 8. I think it was the sdkmanager specifically that didn't play ball on Java > 8 if memory serves me correctly. Android will be officially supporting Java 11 soon (not sure when it will be released but Java11 support is available in their prerelease) |
In my case I had "C:\Program Files\Common Files\Oracle\Java\javapath" in system path before the path to the jdk I wanted cordova to see -C:\Program Files\Java\jdk1.8.0_291\bin |
Thanks so much, unistall and install work for me. Love you bro |
Issue Type
Requirements check failed for JDK 8 ('1.8.*')! Detected version: null
I want to upgrade my Android SDK version API Level 28 to 29. So I have added Android platform version 9.0.0. Then I try to build the APK but I am getting the below error.
'Requirements check failed for JDK 8 ('1.8.*')! Detected version: null
Check your ANDROID_SDK_ROOT / JAVA_HOME / PATH environment variables.'
Information
Command or Code
I found that check_req.js files line no 223 returns output as null.
Environment, Platform, Device
Platform: Android.
Version information
What are relevant versions you are using?
For example:
Cordova: 8.1.0
The text was updated successfully, but these errors were encountered: