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

make necessary changes to update to agp 8.2.2 #382

Closed
wants to merge 4 commits into from

Conversation

smallTrogdor
Copy link
Contributor

No description provided.

@smallTrogdor
Copy link
Contributor Author

#310

@smallTrogdor
Copy link
Contributor Author

Is there an estimate when this PR will be reviewed?

@m0nac0
Copy link
Collaborator

m0nac0 commented Mar 3, 2024

Thanks for contributing! Could you expand a little on the use case for this? That is, is there a specific reason you need to upgrade the AGP? (Not saying we shouldn't do it, I'm just trying to understand the use cases).

And do you know if this is still fully downward compatible, or could this e.g. cause issues when the app runs on old Android versions?

@m0nac0
Copy link
Collaborator

m0nac0 commented Mar 3, 2024

The CI is failing, because we explicitly install Java 11 so far, could you please change the version from 11 to 17 in .github/workflows/flutter_ci.yml line 54?

@smallTrogdor
Copy link
Contributor Author

smallTrogdor commented Mar 12, 2024

Dear @m0nac0 ,
thanks for reviewing! I will make the necessary changes today and commit the changes. As to your questions:

  • The projects that I am working on depend / will depend on this package. As long as the AGP in this package is not upgraded, I will not be able to upgrade my projects / not be able to adopt it. I would not be able to profit from Gradle updates. All people that use this package will have this issue, so the usage could drop in the future.
  • Gradle (and AGP) are generally backwards compatible accross major versions. However, the dependent projects will have to update to gradle 8.
    (please refer https://docs.gradle.org/current/userguide/feature_lifecycle.html#backwards_compatibility)

    EDIT
  • So, I made a mistake in my thinking. Sorry for the confusion! In general, the gradle version in this plugin will not affect the gradle version used to build the apps that use this plugin. Therefore, as long as this project does not use features that were removed / added in gradle 8 from previous versions (which it does not since I can build a project with gradle 7), there is no problem. The only thing that actually matters is the namespace property in the android part of the gradle build file. This property is mandatory from gradle 8 up and will block other projects using gradle 8 and this plugin.

Thank you!

@smallTrogdor
Copy link
Contributor Author

Please see EDIT on previous comment.

@m0nac0
Copy link
Collaborator

m0nac0 commented Mar 13, 2024

So if I understand correctly, we only really need to add the gradle namespace property (and maybe update the group property, if we are already at it) and delete the package attribute from the AndroidManifest, right?
But we do not need to update Gradle, NDK and Java target versions in this plugin, since dependent projects could still use a newer Gradle version, right?

@m0nac0
Copy link
Collaborator

m0nac0 commented Mar 13, 2024

The flutter team seem to have used a conditional version of the namespace property to avoid breaking older projects: flutter/flutter#125621 (comment)

@smallTrogdor
Copy link
Contributor Author

smallTrogdor commented Mar 14, 2024

Your are correct. There is two ways to deal with this:
Keep backwards compatible AGP until eternity (and build the switch like the flutter team) and never use any new features of Gradle ...
Start upgrading the gradle version along with your releases plus ensure forward compatibility (I prefer it this way). Imo it does not make sense to retain backwards compatibility with AGP forever. As pointed out in the Issue you refered to:
(Updating AGP may require other changes in your project as well, but over time using old versions of AGP is going to increasingly cause compatibility issues in general for projects, such as not being able to use current versions of some library dependencies, and not being able to use current versions of Android Studio, so is something anyone still using AGP 4.x should be seriously investigating regardless of this specific issue.) here

So you can choose option A or B and I will implement (maybe going from Gradle 4.x.x directly to 8 is a bit much) it accordingly (or you do it 😄 )

@smallTrogdor
Copy link
Contributor Author

Hi @m0nac0,

can you give me an update on my previous question please ? Would like to close this PR and not have it hanging around forever ...

Thanks!

@smallTrogdor
Copy link
Contributor Author

Hello @m0nac0,

any update??

@kuhnroyal
Copy link
Collaborator

I think we merged most of the changes from another PR, can you check what you think is still missing and open a new PR if required, thanks!

@kuhnroyal kuhnroyal closed this May 17, 2024
@smallTrogdor
Copy link
Contributor Author

smallTrogdor commented May 17, 2024

Hey @kuhnroyal ! So I saw all the good news and the story in #397 and I am really happy you are taking over. I am also thankful to @m0nac0 of course for all the past work - but it seems you are already putting a lot of work into this right now 👍

I can make a subsequent PR for all the changes here (especially bump the example app) - will get to it next week!

@smallTrogdor smallTrogdor deleted the feature/update-agp branch May 17, 2024 18:32
josxha pushed a commit that referenced this pull request May 27, 2024
Since #390, the package can be used with Gradle 8. This is a small PR to
have the example app use Gradle 8 for building (see #382)

Tested with emulator and physical android device.
Remi-deronzier pushed a commit to viamichelin/flutter-maplibre-gl that referenced this pull request Sep 6, 2024
Since maplibre#390, the package can be used with Gradle 8. This is a small PR to
have the example app use Gradle 8 for building (see maplibre#382)

Tested with emulator and physical android device.
Remi-deronzier pushed a commit to viamichelin/flutter-maplibre-gl that referenced this pull request Sep 10, 2024
Since maplibre#390, the package can be used with Gradle 8. This is a small PR to
have the example app use Gradle 8 for building (see maplibre#382)

Tested with emulator and physical android device.
Remi-deronzier pushed a commit to viamichelin/flutter-maplibre-gl that referenced this pull request Sep 10, 2024
Since maplibre#390, the package can be used with Gradle 8. This is a small PR to
have the example app use Gradle 8 for building (see maplibre#382)

Tested with emulator and physical android device.
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.

3 participants