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

track flutter.compileSdkVersion with nsd_android/android/build.gradle compileSdkVersion? #17

Closed
repentsinner opened this issue May 11, 2022 · 4 comments

Comments

@repentsinner
Copy link

Should the compileSdkVersion in nsd_android/android/build.gradle be reverted to 31 along with the change in f7a891a? I'm getting a build warning:

Warning: The plugin nsd_android requires Android SDK version 32.

Thanks!

@sebastianhaberey
Copy link
Owner

Hi @repentsinner,

are you attempting to compile the plugin / example with an Android SDK below 32?

If that's the case, just update your SDK to 32 and you should be fine. It is strongly recommended that you always compile with the latest SDK - see this Article by Ian Lake (Google).

P.S.: that reminds me, I should add the minimum requirements for the plugin to the README.

@sebastianhaberey sebastianhaberey added the waiting for user feedback Additional information requested from user label May 12, 2022
@repentsinner
Copy link
Author

repentsinner commented May 12, 2022

Thanks for the quick reply @sebastianhaberey. I'm using boilerplate build.gradle which pulls compileSdkVersion from flutter:

android {
  compileSdkVersion flutter.compileSdkVersion
  ...
}

Over in the flutter source for stable (as of today, 2.10.5), flutter.compileSdkVersion is (still) defined as 31:

https://github.com/flutter/flutter/blob/5464c5bac742001448fe4fc0597be939379f88ea/packages/flutter_tools/gradle/flutter.gradle#L32-L33

I had a quick look through flutter's issues and other tags/branches and I don't see much discussion/attempt to move it to 32 (even in the newly released flutter 3.0.0) which to your point and Google best practices does seem odd.

If nsd requires a feature of 32 and the main flutter distribution is still using 31, it might be worth making a note in the docs that this should be overridden (but you updated to note that it only requires min 21). If not, does it make sense to just track flutter.compileSdkVersion in nsd's build.gradle so that it'll work with whatever's current, and puts the onus on flutter to correctly manage SdkVersions?

@repentsinner repentsinner changed the title revert nsd_android/android/build.gradle compileSdkVersion to 31 revert nsd_android/android/build.gradle compileSdkVersion to flutter.compileSdkVersion? May 12, 2022
@repentsinner repentsinner changed the title revert nsd_android/android/build.gradle compileSdkVersion to flutter.compileSdkVersion? track flutter.compileSdkVersion with nsd_android/android/build.gradle compileSdkVersion? May 12, 2022
sebastianhaberey added a commit that referenced this issue May 13, 2022
@sebastianhaberey
Copy link
Owner

First off, you're right - I didn't consider that a freshly generated app would have a compileSdkVersion assigned by Flutter, and that most users would just have that version pulled automatically.

Also, I agree that it would be nice to have something like flutter.compileSdkVersion in the plugin to avoid having to update the Gradle configuration manually once Flutter changes their version. Unfortunately, that property doesn't seem to be available for plugins - the Gradle configuration for plugins is different from the one generated for applications.

It seems that the Flutter team is maintaining the compileSdkVersion of their plugin favorites manually to match the Flutter version. So until I learn of a better way, I guess I'll be doing the same.

Please give the new version (1.5.3) a try and see if it works for you!

@repentsinner
Copy link
Author

Looks good to me, thanks!

FWIW I opened an issue on the main flutter project to ask why they're still using SDK 31, curious what they say about that.

flutter/flutter#103713

@sebastianhaberey sebastianhaberey removed the waiting for user feedback Additional information requested from user label May 14, 2022
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

No branches or pull requests

2 participants