From 4820c1af9cf32dd655f16a2901c2d14108976ecf Mon Sep 17 00:00:00 2001 From: Ji Fang Date: Thu, 30 May 2024 13:40:42 +0800 Subject: [PATCH] chore: fix the github CI error when building Android target 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). --- .github/workflows/test_example_plugin_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_example_plugin_build.yml b/.github/workflows/test_example_plugin_build.yml index 7bada24..4fb0252 100644 --- a/.github/workflows/test_example_plugin_build.yml +++ b/.github/workflows/test_example_plugin_build.yml @@ -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