Closed dag7dev closed 4 months ago
I am having the same issue, and after trying a lot of changes the error is still there. But to note is the with codemagic.io the build runs fine.
This is a Java-related issue.
I recommend you make sure you're using a modern JDK when building your app. You can do this by inserting this step before subosito/flutter-action
:
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 21
in your android/app/build.gradle
, make sure you set:
android {
// ...
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
This should help.
@bartekpacia yes, I have tried doing it when running the build. its the same although. Fun fact the code actually works to build in codemagic.io with and without the specific change.
It means some part of environment is different across GHA and codemagic. It's up to you to figure that out.
@bartekpacia ohh, its gonna be hard for me. I am not even a beginner to flutter. sad; thanks for help though
If your project is open-source, you can share link to it and to the workflow and I can take a look.
@bartekpacia no open source, but if you can lend some few minutes of yours; I could add you as collaborator.
@bartekpacia sorry if that was a wrong question from me; although thank you for the help.
no, not at all. feel free to add me as collaborator and i'll spend 5 minutes looking into it. no promises though, i'm quite busy myself.
@bartekpacia hey thanks for your response, I have added you as collaborator. Do let me know of anything, I trust you with the code.
@bhagat-abhishek See the PR. Your problem was using too old Gradle version (8.0) with a too new Java version (21). Please consult gradle-java compat matrix.
There is a different error right now, but I don't have time to fix that. I wish you all the best.
Also I'm going to close this issue right now since it's not related to this action.
@bartekpacia Thanks for you help, I will try it.
workflows/main.yml
Full log
I have no idea what's wrong with it.