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

Migrate to latest Android SDK, AGP and protobuf plugin #763

Closed
wants to merge 21 commits into from

Conversation

ened
Copy link
Contributor

@ened ened commented Jul 5, 2023

fixes #630
fixes #761

closes #754

@ened
Copy link
Contributor Author

ened commented Jul 5, 2023

cc @remonh87 @Taym95

@ened
Copy link
Contributor Author

ened commented Jul 6, 2023

@Taym95 I suggest we merge #762 first, then I rebase, so the checks will pass.

@Taym95
Copy link
Collaborator

Taym95 commented Jul 6, 2023

@Taym95 I suggest we merge #762 first, then I rebase, so the checks will pass.

Yes sure!

ened and others added 4 commits July 6, 2023 15:20
* Bumps to Dart 2.17 minimum and upgrades melos to 3.1.0

* Update root pubspec.yaml with the correct workspace name

Co-authored-by: Taym Haddadi <[email protected]>

* add missing underscore

---------

Co-authored-by: Taym Haddadi <[email protected]>
@ened ened force-pushed the android-agp-update branch from f64c314 to eedc3d3 Compare July 6, 2023 14:21
@ened
Copy link
Contributor Author

ened commented Jul 6, 2023

@Taym95 the build failed but I can not see the logs; please could you invite me to code magic so that I can ?

@Taym95
Copy link
Collaborator

Taym95 commented Jul 6, 2023

@Taym95 the build failed but I can not see the logs; please could you invite me to code magic so that I can ?

I will invite you:

Welcome to Gradle 8.0!

For more details see https://docs.gradle.org/8.0/release-notes.html

Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build failed with an exception.

  • Where:
    Build file '/Users/builder/clone/example/android/app/build.gradle' line: 24

  • What went wrong:
    A problem occurred evaluating project ':app'.

Failed to apply plugin 'com.android.internal.application'.
Android Gradle plugin requires Java 17 to run. You are currently using Java 11.
Your current JDK is located in /Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home
You can try some of the following options:
- changing the IDE settings.
- changing the JAVA_HOME environment variable.
- changing org.gradle.java.home in gradle.properties.

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.

BUILD FAILED in 33s

Build failed :|
Step 6 script Android native tests exited with status code 1

@Taym95
Copy link
Collaborator

Taym95 commented Jul 6, 2023

You need to set JAVA version in:

    environment:
      flutter: stable
      xcode: 13.3
      cocoapods: default
 ->  java: 1.8         # Define default, or platform version (e.g. 11)
      

@ened
Copy link
Contributor Author

ened commented Jul 7, 2023

@Taym95 I created a personal codemagic account and the build runs through - wondering what the issue is here?

@Taym95
Copy link
Collaborator

Taym95 commented Jul 10, 2023

@Taym95 I created a personal codemagic account and the build runs through - wondering what the issue is here?

Still same issues;

`

  • What went wrong:
    A problem occurred evaluating project ':app'.

Failed to apply plugin 'com.android.internal.application'.
Android Gradle plugin requires Java 17 to run. You are currently using Java 11.
Your current JDK is located in /Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home
You can try some of the following options:
- changing the IDE settings.
- changing the JAVA_HOME environment variable.
- changing org.gradle.java.home in gradle.properties.`

@Taym95
Copy link
Collaborator

Taym95 commented Jul 12, 2023

@remonh87 please add @ened to codemagic I don't have admin right to add to the team anymore

@remonh87
Copy link
Contributor

@Taym95 I am not part of the ble team anymore in codemagic. @werediver is admin he can add him. I personally think we should make the build results available public if possible, else maybe we need to consider a different CI

@ened
Copy link
Contributor Author

ened commented Jul 12, 2023

Is there a world in which you'd accept a PR to switch to GitHub actions altogether?
Works great for flutter and is free for open source projects.

@Taym95 @remonh87 @werediver

@werediver
Copy link
Collaborator

@remonh87 please add @ened to codemagic I don't have admin right to add to the team anymore

@Taym95 You are the owned of the team, so you should have all the rights.

Regardless, the fix is explained above. @ened can implement the fix without being a member of that Codemagic team, it's just a YAML-file change (the file is in the repo, "codemagic.yaml").

@ened
Copy link
Contributor Author

ened commented Jul 13, 2023

Regardless, the fix is explained above. @ened can implement the fix without being a member of that Codemagic team, it's just a YAML-file change (the file is in the repo, "codemagic.yaml").

I did, but it still fails. So access to the CI is needed for efficient debugging.

@werediver
Copy link
Collaborator

Codemagic seems to use "codemagic.yaml" from the main branch when building a p/r. The configuration should be updated in a separate p/r.

@Taym95 If you're willing, you may be in a better position updating Codemagic configuration, because you can see all the CI stuff.

@ened
Copy link
Contributor Author

ened commented Jul 14, 2023

Codemagic seems to use "codemagic.yaml" from the main branch when building a p/r. The configuration should be updated in a separate p/r.

@werediver This won't work - the gradle system in use currently is not compatible with Java19. This will yield class file errors like:

* What went wrong:
Could not open settings generic class cache for settings file '/Users/builder/clone/example/android/settings.gradle' (/Users/builder/.gradle/caches/7.0.2/scripts/1445wdyck9xmnqxfk9atcnkpf).
> BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 63

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

My suggestion is to merge this PR now (as mentioned I tested on. my personal code magic account and built the branch directly).

If things are not right, you can always revert.

@Rexios80
Copy link
Contributor

Rexios80 commented Aug 7, 2023

Any progress on this? We need protobuf updated to update other packages.

@remonh87
Copy link
Contributor

remonh87 commented Aug 7, 2023

@ened can you update the java runtime to 17?


A problem occurred evaluating project ':app'.
> Failed to apply plugin 'com.android.internal.application'.
   > Android Gradle plugin requires Java 17 to run. You are currently using Java 11.
      Your current JDK is located in /Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home
      You can try some of the following options:
       - changing the IDE settings.
       - changing the JAVA_HOME environment variable.
       - changing `org.gradle.java.home` in `gradle.properties`.

@cenumi
Copy link

cenumi commented Sep 19, 2023

any updates?

@@ -1,4 +0,0 @@
org.gradle.jvmargs=-Xmx3072m
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it correct this file is removed? 🤔

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really. It should stay.

@@ -1,6 +0,0 @@
#Wed Sep 29 14:33:41 CEST 2021
distributionBase=GRADLE_USER_HOME
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it correct this file (also) is removed? 🤔

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, should be there to let devs of the package specify which Gradle wrapper version to use.

@nathanielheitsch
Copy link
Contributor

Any update on this?

@remonh87
Copy link
Contributor

@ened do you need help with the last remarks. I really would like to integrate it so we are compliant to AGP8 and new protobuf

@AndreaBalde
Copy link

Any update on this merge request?

@vbuberen
Copy link
Contributor

vbuberen commented Jan 8, 2024

@Taym95 @werediver
Which help is needed to move this topic forward? I can step in and help if needed as did the same update to AGP 8 in other packages last year as well: firebase/flutterfire#11699

Currently, flutter_reactive_ble not supporting AGP 8 blocks one of my work projects, so I would like to help here if needed to make this thing merged faster.

@Taym95
Copy link
Collaborator

Taym95 commented Jan 11, 2024

This was merged with #830

@Taym95 Taym95 closed this Jan 11, 2024
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.

AGP fails due to com.google.protobuf version [Android] CVE-2022-3171 found in the package
10 participants