Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-28375

Android: Hyperloop fails to access enum types with JDK 12

    Details

    • Story Points:
      5

      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:

      1. Set up the system with JDK 12 or higher.
      2. Build and run hyperloop-examples on Android.
      3. Tap on "Blur" in the list.
      4. 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 <JdkVersion> below.)

      export JAVA_HOME=$(/usr/libexec/java_home -v <JdkVersion>)
      

      Work-around:
      Use JDK 11 instead.

        Attachments

          Activity

            People

            • Assignee:
              jquick Joshua Quick
              Reporter:
              jquick Joshua Quick
              Reviewer:
              Gary Mathews
              Tester:
              Satyam Sekhri
            • Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                  Git Integration