Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27781] Android: App/Module builds fail with JDK 13 as of 9.0.0

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2020-04-10T22:26:29.000+0000
Affected Version/sRelease 9.0.0
Fix Version/sRelease 9.0.1
ComponentsAndroid
Labelsandroid, build, gradle, jdk, regression
ReporterJoshua Quick
AssigneeJoshua Quick
Created2020-02-26T19:38:11.000+0000
Updated2020-04-16T01:20:25.000+0000

Description

*Summary:* When building an app or module with Titanium 9.0.0, the build will fail if JDK 13 is installed. Titanium 8.3.x builds fine with JDK 13... except for Hyperloop builds: [TIMOB-27780] *Steps to reproduce:*

Install JDK 13.

Create a Titanium app project.

Build with Titanium 9.0.0 for Android.

*Result:*
[ERROR] [GRADLE] FAILURE: Build failed with an exception.
[ERROR] [GRADLE] 
[ERROR] [GRADLE] * Where:
[ERROR] [GRADLE] Settings file '/Users/jquick2/Documents/Appcelerator_Studio_Workspace/kitchensink-v2/build/android/settings.gradle'
[ERROR] [GRADLE] 
[ERROR] [GRADLE] * What went wrong:
[ERROR] [GRADLE] Could not compile settings file '/Users/jquick2/Documents/Appcelerator_Studio_Workspace/kitchensink-v2/build/android/settings.gradle'.
[ERROR] [GRADLE] > startup failed:
[ERROR] [GRADLE]   General error during semantic analysis: Unsupported class file major version 57
[ERROR] [GRADLE]   
[ERROR] [GRADLE]   java.lang.IllegalArgumentException: Unsupported class file major version 57
[ERROR] [GRADLE]   	at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:184)
[ERROR] [GRADLE]   	at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:166)
[ERROR] [GRADLE]   	at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:152)
[ERROR] [GRADLE]   	at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:273)
*Cause:* As of Titanium 9.0.0, we now build with gradle. We're currently using gradle v5.4.1 which does not support JDK 13. We'll need to upgrade to gradle v6.0.x (released January 2020) which supports JDK 13. https://docs.gradle.org/6.0/release-notes.html#java-13 *Note:* You can have multiple JDK installations on Mac. You can list the JDK versions installed by entering the following at the command line.
/usr/libexec/java_home -V
You can select which installed JDK version to use by entering the following at the command line. You'll need to set the <JavaVersion> to what's installed, which the above command line will list. The below can be set in your .bash_profile file.
export JAVA_HOME=$(/usr/libexec/java_home -v <JavaVersion>)
*Work-Around:* Downgrade to JDK 12 or lower. (JDK 8 is the min version needed.)

Attachments

FileDateSize
ti.imagefactory_errors.rtf2020-03-20T12:08:29.000+000013092

Comments

  1. Joshua Quick 2020-02-29

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/11507 PR (9.0.x): https://github.com/appcelerator/titanium_mobile/pull/11510
  2. Sohail Saddique 2020-03-20

  3. Sohail Saddique 2020-03-20

    *Test Environment* SDK Ver: 8.3.1.GA & 9.0.0.GA & 9.0.1 & 9.1.0 OS Ver: 10.14.6 Appc NPM: 5.0.0 Appc CLI: 8.0.0 Daemon Ver: 3.2.0 Ti CLI Ver: 5.2.2 Alloy Ver: 1.14.6 Node Ver: 10.17.0 Java Ver: 1.8.0 & 12.0.2 & 13.0.2 Emulator: ⇨ Android 10 (API 29)
  4. Joshua Quick 2020-03-20

    [~ssaddique], the module still builds fine, right? The issue we are having as of 9.0.0 is that the Java compiler "warnings" are being reported via "stderr", which our CLI reports as errors. We don't have a good work-around for this at the moment since "warnings" are reported inconsistently via the different gradle tools.
  5. Sohail Saddique 2020-03-20

    [~jquick] Yep, the module still builds fine. In light of this information, I can therefore pass this ticket and merge the PR's.
  6. Joshua Quick 2020-03-20

    [~ssaddique], thanks for the detailed investigation. That's what I like to see. :)
  7. Lokesh Choudhary 2020-04-10

    Verified the fix with JDK 13.0.2 & SDK 9.0.1.v20200409133209. Closing.

JSON Source