Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-28375] Android: Hyperloop fails to access enum types with JDK 12

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2021-03-11T14:41:44.000+0000
Affected Version/sn/a
Fix Version/sRelease 10.0.0
ComponentsAndroid, Hyperloop
Labelsandroid, enum, hyperloop
ReporterJoshua Quick
AssigneeJoshua Quick
Created2021-03-05T04:32:34.000+0000
Updated2021-03-11T14:41:44.000+0000

Description

*Summary:* If JDK 12 or higher is installed, Hyperloop fails to generate a working proxy for Java enum types which will cause a runtime error when used. *Steps to reproduce:*

Set up the system with JDK 12 or higher.

Build and run [hyperloop-examples](https://github.com/appcelerator/hyperloop-examples) on Android.

Tap on "Blur" in the list.

Notice the below exception occurs.

[ERROR] TiExceptionHandler: (main) [3565,4127] ti:/module.js:297
[ERROR] TiExceptionHandler: 	throw new Error('Requested module not found: ' + request); // TODO Set 'code' property to 'MODULE_NOT_FOUND' to match Node?
[ERROR] TiExceptionHandler:  ^
[ERROR] TiExceptionHandler: Error: Requested module not found: ./java.lang.Enum
[ERROR] TiExceptionHandler:     at Module.require (ti:/module.js:297:8)
[ERROR] TiExceptionHandler:     at Module.global.Module.require (<embedded>:5050:34)
[ERROR] TiExceptionHandler:     at require (ti:/module.js:550:15)
[ERROR] TiExceptionHandler:     at /hyperloop/android.graphics.Bitmap$Config.js:36:18
*Note:* If the above error did not occur, then that means a valid Java class metabase file was generated by JDK 11 or older and hyperloop is re-using it. Search for the following line in the build log and delete the file it references.
[Hyperloop] Using system metabase cache file at </path/to/file.json.gz>
*How to change JDK version on Mac:* Entering the following at the command line will list all JDK versions installed on Mac...
/usr/libexec/java_home -V
You can switch JDK versions used on Mac by entering the following. _(Make sure to replace below.)_
export JAVA_HOME=$(/usr/libexec/java_home -v <JdkVersion>)
*Work-around:* Use JDK 11 instead.

Comments

  1. Joshua Quick 2021-03-05

    PR (hyperloop.next): https://github.com/appcelerator/hyperloop.next/pull/349
  2. Joshua Quick 2021-03-10

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/12540
  3. Satyam Sekhri 2021-03-11

    FR Passed. Waiting for Jenkins build
  4. Christopher Williams 2021-03-11

    merged hyper loop update to master and 10_0_X for 10.0.0 target

JSON Source