[TIMOB-28375] Android: Hyperloop fails to access enum types with JDK 12
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2021-03-11T14:41:44.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 10.0.0 |
Components | Android, Hyperloop |
Labels | android, enum, hyperloop |
Reporter | Joshua Quick |
Assignee | Joshua Quick |
Created | 2021-03-05T04:32:34.000+0000 |
Updated | 2021-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:*
below.)_
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
export JAVA_HOME=$(/usr/libexec/java_home -v <JdkVersion>)
*Work-around:*
Use JDK 11 instead.
PR (hyperloop.next): https://github.com/appcelerator/hyperloop.next/pull/349
PR (master): https://github.com/appcelerator/titanium_mobile/pull/12540
FR Passed. Waiting for Jenkins build
merged hyper loop update to master and 10_0_X for 10.0.0 target