Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: support build as a flutter module #70

Merged
merged 4 commits into from
Jun 11, 2024

Conversation

jifang
Copy link
Contributor

@jifang jifang commented May 29, 2024

When build as a flutter module and integrated into the existing android project, there is no applicationVariants and result in following compilation failure:

Could not get unknown property 'applicationVariants' for extension 'android' of type com.android.build.gradle.LibraryExtension.

In such case, we will use libraryVariants instead

superlistapp/super_native_extensions#379

When build as a flutter module and integrated into the existing android project,
there is no applicationVariants and result in following compilation failure:

Could not get unknown property 'applicationVariants' for extension 'android' of
type com.android.build.gradle.LibraryExtension.

In such case, we will use libraryVariants instead
@jifang
Copy link
Contributor Author

jifang commented May 30, 2024

Not an expert on github action CI.

From the error message

[        ] > BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 65

It seems the github action CI is using Java 21 (class version 65) and gradle 7.5 doesn't support it

The command to execute the gradle task is

[        ] Starting process 'Gradle build daemon'. Working directory: /Users/runner/.gradle/daemon/7.5 Command: /Users/runner/hostedtoolcache/Java_Temurin-Hotspot_jdk/21.0.3-9.0/arm64/Contents/Home/bin/java ... ...

Not sure why it is using JDK 21 as the workfile specifies the JDK11?

Ji Fang added 3 commits May 30, 2024 11:18
Sometimes gradle may use JDK21 to execute the task which is not supported by
gradle7.5

Ensure Gradle uses the correct Java home during the Android build step
If MacOS is running on the Apple M chips, we should pick the correct arch
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).
@jifang
Copy link
Contributor Author

jifang commented May 30, 2024

@knopp Could you take a look of this PR? I also managed to fix the workflow failure.
https://github.com/jifang/cargokit/actions

@knopp knopp merged commit d56f1f2 into irondash:main Jun 11, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants