Rush build fails with unsupported class file version error

Can’t compile extensions in java (in kotlin yes can)

Package name should be

com.package.name :white_check_mark:

com.package:x:

@mordechay

There is still an error:

PS C:\Users\mor\Desktop\project> rush create bbbb
                      __
     _______  _______/ /_
    / ___/ / / / ___/ __ \
   / /  / /_/ (__  / / / /
  /_/   \__,_/____/_/ /_/

? Organisation (package name) com.aaaa.bbbb
? Author bbbb
? Version name 1
? Language (Use arrow or w/s keys to navigate & press enter to select)
 ❯ Java
   Kotlin

• Getting things ready...
• Success! Generated a new AI2 extension project in: C:\Users\mor\Desktop\project\bbbb

Next up,
  - cd into bbbb/, and
  - run rush build to compile your extension.
PS C:\Users\mor\Desktop\project> cd bbbb
PS C:\Users\mor\Desktop\project\bbbb> rush build
                      __
     _______  _______/ /_
    / ___/ / / / ___/ __ \
   / /  / /_/ (__  / / / /
  /_/   \__,_/____/_/ /_/

• Build initialized

┌ Checking project files
│ info Checking metadata file (rush.yml)
│ info Checking AndroidManifest.xml file
└ done
┌ Compiling sources
│ info Picked 1 source file
└ done
┌ Processing the extension
│ info Linking extension assets
│ info Generating DEX bytecode
│      Compilation failed with an internal error.
│      java.lang.IllegalArgumentException: Unsupported class file major version 60
│       at com.android.tools.r8.A.a.a.f.<init>(:10)
│       at com.android.tools.r8.A.a.a.f.<init>(:2)
│       at com.android.tools.r8.A.a.a.f.<init>(:1)
│       at com.android.tools.r8.A.a.a.f.<init>(:107)
│       at com.android.tools.r8.graph.x0.a(:24)
│       at com.android.tools.r8.dex.a$a.a(:12)
│       at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(Unknown Source)
│       at java.util.concurrent.ForkJoinTask.doExec(Unknown Source)
│       at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(Unknown Source)
│       at java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)
│       at java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)
└ failed

• Build failed [4s 283ms] []

The version of JDK that you’re using is higher than the required version, i.e., 8. Please install version 8 of JDK and try rebuilding the extension.

PS: You might need to set the JAVA_HOME environment variable to the JDK 8 installation location if you have multiple JDKs installed on your PC.

2 Likes

I can not find where to download it, Can you get me a download link.

(Note: Zulu JDK builds are my personal preference, you are free to use any other distribution)

1 Like

Also see here

1 Like

What should I download from all options there?
Is that what I need?:
Java SE Development Kit 8u202

1 Like

I installed, and now I have this error:

PS C:\Users\mor\Desktop\project> rush create dddd
                      __
     _______  _______/ /_
    / ___/ / / / ___/ __ \
   / /  / /_/ (__  / / / /
  /_/   \__,_/____/_/ /_/

? Organisation (package name) com.dddd.dddd
? Author dddd
? Version name dddd
? Language (Use arrow or w/s keys to navigate & press enter to select)
 ❯ Java
   Kotlin

• Getting things ready...
• Success! Generated a new AI2 extension project in: C:\Users\mor\Desktop\project\dddd

Next up,
  - cd into dddd/, and
  - run rush build to compile your extension.
PS C:\Users\mor\Desktop\project> cd dddd
PS C:\Users\mor\Desktop\project\dddd> rush build
                      __
     _______  _______/ /_
    / ___/ / / / ___/ __ \
   / /  / /_/ (__  / / / /
  /_/   \__,_/____/_/ /_/

• Build initialized

┌ Checking project files
│ info Checking metadata file (rush.yml)
│ info Checking AndroidManifest.xml file
└ done
┌ Compiling sources
│ info Picked 1 source file
└ failed

• Build failed [46ms] []

Try to re-install rush

1 Like

Does not work

@mordechay
I faced the same problem and the solution is that I changed the version of Windows I was using and just reinstalled Rush

I did not understand, Do you have a solution for me??

I succeeded !!!
I opened a new PowerShell window (it probably won’t update until a new window opens)
I think it’s worth updating this in the main post (rush), that the fact that the window was open before the changes could make issues

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.