[TIMOB-27780] Android: Hyperloop builds fail if JDK 12 or higher is installed
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2020-04-10T22:27:18.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 9.0.1 |
Components | Android, Hyperloop |
Labels | android, build, hyperloop, jdk |
Reporter | Joshua Quick |
Assignee | Joshua Quick |
Created | 2020-02-26T04:28:28.000+0000 |
Updated | 2020-04-10T22:27:18.000+0000 |
Description
*Summary:*
If you have JDK 12 or higher installed on your machine, then Titanium apps using the Hyperloop module will fail to build.
*Steps to reproduce:*
Install JDK 12 or higher on your machine.
Build [hyperloop-example](https://github.com/appcelerator/hyperloop-examples) for Android.
Notice the build *fails* with the following error message.
[ERROR] hyperloop:generateMetabase: Failed to generated metabase: warning: [options] bootstrap class path not set in conjunction with -source 6
error: Source option 6 is no longer supported. Use 7 or later.
error: Target option 6 is no longer supported. Use 7 or later.
*Cause:*
As of JDK 12, Oracle has dropped support for the Java 6 language.
https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8028563
Hyperloop currently hardcodes its usage of the javac
command line tool during the build to Java 1.6, which is why it fails when using the newest JDK.
[android/hooks/metabase/metabase.js#L41](https://github.com/appcelerator/hyperloop.next/blob/24feb99f719da5e3df279452526638d46fa0043a/android/hooks/metabase/metabase.js#L41)
*Solution:*
Update javac
usage to use Java 1.8 instead.
*Note:*
For JDK 13 support, we'll likely need to update Titanium's gradle template to 6.x.x as well, which means updating our Android build tools to 3.6.x via [TIMOB-27778].
PR (hyperloop.next): https://github.com/appcelerator/hyperloop.next/pull/336 PR (master): https://github.com/appcelerator/titanium_mobile/pull/11507 PR (9.0.x): https://github.com/appcelerator/titanium_mobile/pull/11510
Verified the fix with NDK 13.0.2 & SDK 9.0.1.v20200409133209. Closing.