Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

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

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2020-05-04T23:52:00.000+0000
Affected Version/sRelease 9.0.0
Fix Version/sRelease 9.0.2
ComponentsAndroid
Labelsandroid, build, gradle, jdk
ReporterJoshua Quick
AssigneeJoshua Quick
Created2020-04-16T01:04:57.000+0000
Updated2020-05-04T23:52:00.000+0000

Description

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

Install JDK 14.

Create a Titanium app project.

Build with Titanium 9.0.1 for Android. (9.0.1 supports JDK 13.)

*Result:*
[ERROR] [GRADLE] 
[ERROR] [GRADLE] FAILURE: Build failed with an exception.
[ERROR] [GRADLE] 
[ERROR] [GRADLE] * What went wrong:
[ERROR] [GRADLE] Could not initialize class org.codehaus.groovy.runtime.InvokerHelper
[ERROR] [GRADLE] 
[ERROR] [GRADLE] * Try:
[ERROR] [GRADLE] 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.
[ERROR] [GRADLE] 
[ERROR] [GRADLE] * Get more help at https://help.gradle.org
[ERROR] [GRADLE] 
[ERROR] [GRADLE] BUILD FAILED in 597ms
[ERROR] "gradlew" tool returned exit code: 1
*Cause:* As of Titanium 9.0.0, we now build with gradle. We need to upgrade gradle to v6.3.0 which recently added JDK 14 support. https://docs.gradle.org/6.3/release-notes.html *To-Do:* In folder titanium_mobile/android, execute below command line to upgrade gradle wrapper files.
./gradlew wrapper --distribution-type all --gradle-version 6.3
We should also update our com.android.tools.build:gradle tool to version 3.6.2 for files... https://github.com/appcelerator/titanium_mobile/blob/master/android/build.gradle https://github.com/appcelerator/titanium_mobile/blob/master/android/templates/build/root.build.gradle *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 13 for Titanium 9.0.1. Downgrade to JDK 12 for Titanium 9.0.0. (See [TIMOB-27781]) (JDK 8 is the min version needed.)

Comments

  1. Joshua Quick 2020-04-16

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/11636 PR (9.0.x): https://github.com/appcelerator/titanium_mobile/pull/11637
  2. Satyam Sekhri 2020-04-28

    FR Passed. App and module builds fine with different java versions(11,13,14)
  3. Satyam Sekhri 2020-04-28

    Waiting for Jenkins build on master.
  4. Christopher Williams 2020-04-29

    merged to master
  5. Satyam Sekhri 2020-05-04

    Verified on: Mac OS: 10.15.4 SDK: 9.0.2.v20200504063604, 9.1.0.v20200504090422 Appc CLI: 8.0.0 JDK: 11.0.6, 13.0.2, 14.0.1 Node: 10.17.0 Device: Pixel3(v10.0) emulator

JSON Source