Skip to content

Commit

Permalink
chore: fix the github CI error when building Android target
Browse files Browse the repository at this point in the history
Change the JAVA SDK to JAVA17 on MacOS arm64 chips

This commit is to fix the following error when running action on MacOS target
with Apple sillicon chips.

Error: LinkageError occurred while loading main class com.android.sdklib.tool.sdkmanager.SdkManagerCli
java.lang.UnsupportedClassVersionError: com/android/sdklib/tool/sdkmanager/SdkManagerCli
has been compiled by a more recent version of the Java Runtime (class file
version 61.0), this version of the Java Runtime only recognizes class file
versions up to 55.0

The class com.android.sdklib.tool.sdkmanager.SdkManagerCli was compiled with a
newer version of Java (class file version 61.0, which corresponds to Java 17),
but the Java runtime environment being used only supports class file versions up
to 55.0 (which corresponds to Java 11).
  • Loading branch information
Ji Fang committed May 30, 2024
1 parent c48362e commit 4820c1a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/test_example_plugin_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
working-directory: ${{ env.EXAMPLE_DIR }}
run: |
if [[ $(sysctl hw.optional.arm64) == *"hw.optional.arm64: 1"* ]]; then
export JAVA_HOME=$JAVA_HOME_11_arm64
export JAVA_HOME=$JAVA_HOME_17_arm64
else
export JAVA_HOME=$JAVA_HOME_11_X64
fi
Expand Down

0 comments on commit 4820c1a

Please sign in to comment.