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

NEVISACCESSAPP-5853: Updated Android configuration to use Gradle 8.4.0 and above and AGP 8.3.0 and above #53

Merged
merged 5 commits into from
Oct 4, 2024

Conversation

laszlo-domonkos
Copy link
Contributor

No description provided.

…0 and above and AGP 8.3.0 and above

NEVISACCESSAPP-5853: Updated Android configuration to use Gradle 8.x
Copy link
Contributor

@balazs-gerlei balazs-gerlei left a comment

Choose a reason for hiding this comment

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

I added a couple of questions and asked for one change, please check them and feel free to reach out if we need to discuss something!

android/gradle/wrapper/gradle-wrapper.properties Outdated Show resolved Hide resolved
Comment on lines -50 to +51
targetSdkVersion flutter.targetSdkVersion
targetSdkVersion 34
Copy link
Contributor

Choose a reason for hiding this comment

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

❓ I don't know this about Flutter, but what is the reason to no longer use flutter.targetSdkVersion? It's just strange to me that so far we relied on that and now we explicitly define it. I understand that we want to update but can't we update flutter.targetSdkVersion somehow and if not, wouldn't it cause a problem if we use a different targetSdkVersion?

Copy link
Contributor

Choose a reason for hiding this comment

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

This variable is defined in the Flutter SDK and cannot "update" it. As far as I can remember it is still to low or at least other than 34. I don't have any objection with overriding it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, @tamas-toth is right. There is no way to set its value, so we cannot use that variable because its value is still 33, but it really depends on the installed Flutter SDK. As Google Play Store restricted to use 34 I would not use this variable but using a strict value instead.

Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this defined here? If so, it seems to be 34 already, what is the reason that it's not the same for us?

Copy link
Contributor

@balazs-gerlei balazs-gerlei Oct 3, 2024

Choose a reason for hiding this comment

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

We discussed this in a Huddle and my worry is basically that the targetSdk defines what restrictions apply to a certain app when running on Android. Having a higher targetSdk for an app than what is defined in a library (in this case Flutter itself) is not necessarily a problem but it can be. The library maintainers could only assume restrictions that the targetSdk they defined bring with it when writing their library so it is possible that the newer restrictions that the app applies to it with a higher targetSdk cause a bug or even a crash.

For example Google started to restrict the usage of private APIs in the recent Android versions and these restrictions only apply to apps if they define these newer Android versions as their targetSdk. So it is possible that for example Flutter developers assumed it is okay to call into one of such private APIs via reflection and it is only true for the targetSdk they defined.

For these reasons I think it would be better to set the targetSdk version (and also compileSdk) to the same as the Flutter version that the app uses, but that would mean we need to upgrade to newer Flutter version (I checked and the next one, 3.22.0 already defines 34 as the targetSdk version) which is a bigger task.

We should consider and discuss this, but for the time being, I think it's okay to override targetSdk here and I won't forgo approving the PR for this reason. Even if we agree to upgrade Flutter, it can be done as a follow-up.

android/gradle.properties Outdated Show resolved Hide resolved
Copy link
Contributor

@tamas-toth tamas-toth left a comment

Choose a reason for hiding this comment

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

🔧 Can you please update the README as well?

@laszlo-domonkos
Copy link
Contributor Author

🔧 Can you please update the README as well?

Fixed.

@laszlo-domonkos laszlo-domonkos merged commit 452be88 into develop Oct 4, 2024
3 checks passed
@laszlo-domonkos laszlo-domonkos deleted the feature/NEVISACCESSAPP-5853 branch October 4, 2024 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants