Could not determine java version from '12.0.1'.

spinal

New member
Joined
Jul 2, 2019
Messages
5
Hi guys, new here :)

Anyhow, I was following the guide on how to setup the android target, but get the following error when building...

Code:
"C:/Cerberus/bin/transcc_winnt" -target=Android_Game -config=Debug "C:/Cerberus/examples/mojo/mikehart/BitmapFont/BitmapFont.cxs"
TRANS cerberus compiler V2019-02-21
Parsing...
Semanting...
Translating...
Building...

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine java version from '12.0.1'.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org
TRANS FAILED: Android build failed.
Done.

From what I can tell, I think I followed the instructions correctly, with the following changes to config.winnt.txt -
Code:
'--------------------
'Java dev kit path
'
'Must be set to a valid dir for ANDROID and FLASH target support
'
'The Java JDK is currently available here: http://www.oracle.com/technetwork/java/javase/downloads/index.html
'
JDK_PATH="C:\Program Files\Java\jdk-12.0.1"
'--------------------

'--------------------
'Android SDK and tool paths.
'
'Must be set to a valid dir for ANDROID target support
'
ANDROID_PATH="C:\Program Files\Android\Android Studio"
'--------------------

reflecting where I installed android studio and java sdk.
I made sure to download API24 inside android studio as that is the version used in the guide.

Any idea if I messed something?
Thanks.
 

dawlane

Well-known member
CX Code Contributor
Joined
Jun 21, 2017
Messages
795
The Android SDK is in a different location to Android Studio. So the Android path is wrong.
 

spinal

New member
Joined
Jul 2, 2019
Messages
5
The Android SDK is in a different location to Android Studio. So the Android path is wrong.
Although that is probably correct (I changed it to match the path given inside android studio for the sdk path), the error seems to come from
Code:
JDK_PATH="C:\Program Files\Java\jdk-12.0.1"
 

dawlane

Well-known member
CX Code Contributor
Joined
Jun 21, 2017
Messages
795
Although that is probably correct (I changed it to match the path given inside android studio for the sdk path), the error seems to come from
Code:
JDK_PATH="C:\Program Files\Java\jdk-12.0.1"
It's doesn't have anything to do with the JDK. This is a gradle (the Android build tool) installation issue. Most commonly this.
 

MikeHart

Administrator
Joined
Jun 19, 2017
Messages
2,815
The one that I am using at the moment is:

Code:
JDK_PATH="D:\Program Files (x86)\Java\jdk1.8.0_181"
 

spinal

New member
Joined
Jul 2, 2019
Messages
5
The one that I am using at the moment is:

Code:
JDK_PATH="D:\Program Files (x86)\Java\jdk1.8.0_181"

Thanks guys.
Using the older version seems to have done the trick! Now to dig out some old monkey code and build something!
 

MikeHart

Administrator
Joined
Jun 19, 2017
Messages
2,815
Cood for you. I tried the new version too and managed that it does not work for me anymore.
 

bonajkukoj

New member
Joined
May 21, 2020
Messages
6
Unfortunately, I got the same error, just with '14.0.1'.
I now installed an older version (JDK8), and then get these errors:


Code:
"C:/Users/tetra/Cerberus/bin/transcc_winnt" -target=Android_Game -config=Release "C:/Users/tetra/Cerberus/user/Test1.cxs"
TRANS cerberus compiler V2020-05-09
Parsing...
Semanting...
Translating...
Building...

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not resolve com.android.tools.build:gradle:3.2.1.
     Required by:
         project :
      > Could not resolve com.android.tools.build:gradle:3.2.1.
         > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom'.
            > Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom'.
               > java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
      > Could not resolve com.android.tools.build:gradle:3.2.1.
         > Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom'.
            > Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom'.
               > java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s
TRANS FAILED: Android build failed.
Done.

Could it be a too old Gradle Version (3.2.1)? The current one is 6.4.1
Or maybe it has to do with my Android Studio being the brandnew 4.0?

Is someone so kind to help?

EDIT: The Build works for Desktop and HTML5 Targets
 

MikeHart

Administrator
Joined
Jun 19, 2017
Messages
2,815
I am running an older JAVA version:

JDK_PATH="D:\Program Files (x86)\Java\jdk1.8.0_172"
Android Studio 3.6.2

Works fine here.
 
Last edited:

Phil7

Administrator
CX Code Contributor
3rd Party Tool Dev
Joined
Jun 26, 2017
Messages
540
Newer Versions of Android Studio already ship with Java SDK included. Maybe it is best to point to this as the default for new cerberus installations. The path is ...\AndroidStudio\jre BTW don't get fooled by the name jre. The real Java Runtime Environment is located in \AndroidStudio\jre\jre :p
 
Top Bottom