-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[shared_preferences] Platform implementations of async api #6965
Conversation
0a4a7f8
to
70bb580
Compare
@reidbaker any chance you can help me diagnose this gradle issue? |
I believe that (" |
Unsupported class file major version 65 means you are using java 21 and should be using something lower more detail here Looking at your changes I dont see anything that should cause this failure. @christopherfujino do you see something about this machine config that would cause it to run java 21 instead of the lower java versions we expect. |
The machine should definitely be using 17: Line 32 in 3144ac0
Could it be something precompiled that used 21? |
packages/shared_preferences/shared_preferences_android/android/build.gradle
Outdated
Show resolved
Hide resolved
...android/example/android/app/src/androidTest/java/io/flutter/plugins/DartIntegrationTest.java
Show resolved
Hide resolved
...d_preferences_foundation/Sources/shared_preferences_foundation/SharedPreferencesPlugin.swift
Outdated
Show resolved
Hide resolved
...ages/shared_preferences/shared_preferences_foundation/lib/shared_preferences_foundation.dart
Outdated
Show resolved
Hide resolved
packages/shared_preferences/shared_preferences_android/lib/shared_preferences_android.dart
Outdated
Show resolved
Hide resolved
@@ -2,13 +2,15 @@ group 'io.flutter.plugins.sharedpreferences' | |||
version '1.0-SNAPSHOT' | |||
|
|||
buildscript { | |||
ext.kotlin_version = '1.8.10' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@reidbaker Is this going to cause issues for clients? It looks like this would be the first of our plugins using 1.8.x.
@tarrinneal What exactly was the error when this was 1.7.10 like our other plugins?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Integration tests run fine though, only unit tests fail. There may be some other underlying issue.
packages/shared_preferences/shared_preferences_foundation/CHANGELOG.md
Outdated
Show resolved
Hide resolved
@tarrinneal I played around with a bit locally, and if I add the @reidbaker Does that seem like a reasonable thing to do? I'm still not clear why this example needs a different |
It seems weird to me that example/android/build.gradle cant use kotlin 1.8.22. The only reason for that would be if the dependencies used in example/android/app/build.gradle were too old to use a newer version of kotlin. In general I think it is ok to have the example app have whatever version of kotlin but it seems to me like they should be aligned. |
To clarify, maybe it can use 1.8.22. What doesn't work is continuing to use 1.7.10, even though that's what every other package we have that uses the bom workaround thing is doing. |
And to put some numbers to that:
So in seven other plugins, just adding the bom line seems to be enough, but here we also need to bump the example app's Kotlin version. |
IIRC there was an issue fixed in kotlin 1.8.* that fixed situations where when you had multiple kotlin versions between the app and libraries that you would have duplicate files and the work around was to add the kotlin bom. @gmackall might remember the exact versions. |
Any ideas why the bom isn't working for this pr? |
Since it works if we update Kotlin only in the example app, I would just add that to unblock the PR. We have the build-all app ensuring that it works in an app that doesn't set a higher Kotlin version. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
dependencies { | ||
// org.jetbrains.kotlin:kotlin-bom artifact purpose is to align kotlin stdlib and related code versions. | ||
// See: https://youtrack.jetbrains.com/issue/KT-55297/kotlin-stdlib-should-declare-constraints-on-kotlin-stdlib-jdk8-and-kotlin-stdlib-jdk7 | ||
implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.10")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weird, I figured you'd still need this part. 🤷🏻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you stuck on legacy as the prefix? The meaning of legacy can change over time so v1 might be a better prefix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think legacy is pretty fitting, as it is now legacy code. It implies future intent to deprecate the code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue is legacy assumes 2 states, Legacy and Current and does not account for a 3rd state to exist at the same time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is something I don't remember to think about until you raise it in reviews, but I'm trying to internalize it into my normal review process :)
I agree it would have been better not to use that name, but in this case I think it'll end up okay, because this was a big change to an API surface that we very explicitly don't want a lot of churn to, and hasn't been fundamentally changed like this in the entire life of the plugin. It's a very different case than, e.g., Android older API version codepaths, where this has come up before, where we can easily get new ones every year.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep I did not view it as a blocker which was why it came paired with an approval. It was just the dismissal that "I think legacy is pretty fitting, as it is now legacy code." that I wanted to expand upon since that misses my entire reason for commenting on the name.
I should have linked to the style guide. https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md#avoid-newold-modifiers-in-code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code, and the names specifically, can also change any time without breaking anything, as this is just the native platform implementation. If there does end up being another massive overhaul before it's deprecated, we can just change it to something else at that time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's always LegacyLegacy
;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes there is hahaha 😭
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was just the dismissal that "I think legacy is pretty fitting, as it is now legacy code." that I wanted to expand upon since that misses my entire reason for commenting on the name.
Totally fair, I was missing the expanded context so I appreciate the comment :)
flutter/packages@99e8606...46a712f 2024-07-31 [email protected] [interactive_media_ads] Adds initial iOS implementation (flutter/packages#7063) 2024-07-31 49699333+dependabot[bot]@users.noreply.github.com [webview]: Bump androidx.annotation:annotation from 1.7.1 to 1.8.1 in /packages/webview_flutter/webview_flutter_android/android (flutter/packages#6770) 2024-07-31 49699333+dependabot[bot]@users.noreply.github.com [interactive_media_ads]: Bump androidx.annotation:annotation from 1.8.0 to 1.8.1 in /packages/interactive_media_ads/android (flutter/packages#7238) 2024-07-30 [email protected] [shared_preferences] full api redesign with DataStore and cache-less interface (flutter/packages#5210) 2024-07-30 49699333+dependabot[bot]@users.noreply.github.com [url_launcher]: Bump androidx.browser:browser from 1.5.0 to 1.8.0 in /packages/url_launcher/url_launcher_android/android (flutter/packages#6811) 2024-07-30 49699333+dependabot[bot]@users.noreply.github.com [in_app_pur]: Bump com.android.billingclient:billing from 6.1.0 to 6.2.0 in /packages/in_app_purchase/in_app_purchase_android/android (flutter/packages#6413) 2024-07-30 [email protected] [path_provider] fix 151823: update minimum required path_provider_android to 2.2.0 (flutter/packages#7181) 2024-07-30 [email protected] [shared_preferences] Platform implementations of async api (flutter/packages#6965) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
flutter/packages@99e8606...46a712f 2024-07-31 [email protected] [interactive_media_ads] Adds initial iOS implementation (flutter/packages#7063) 2024-07-31 49699333+dependabot[bot]@users.noreply.github.com [webview]: Bump androidx.annotation:annotation from 1.7.1 to 1.8.1 in /packages/webview_flutter/webview_flutter_android/android (flutter/packages#6770) 2024-07-31 49699333+dependabot[bot]@users.noreply.github.com [interactive_media_ads]: Bump androidx.annotation:annotation from 1.8.0 to 1.8.1 in /packages/interactive_media_ads/android (flutter/packages#7238) 2024-07-30 [email protected] [shared_preferences] full api redesign with DataStore and cache-less interface (flutter/packages#5210) 2024-07-30 49699333+dependabot[bot]@users.noreply.github.com [url_launcher]: Bump androidx.browser:browser from 1.5.0 to 1.8.0 in /packages/url_launcher/url_launcher_android/android (flutter/packages#6811) 2024-07-30 49699333+dependabot[bot]@users.noreply.github.com [in_app_pur]: Bump com.android.billingclient:billing from 6.1.0 to 6.2.0 in /packages/in_app_purchase/in_app_purchase_android/android (flutter/packages#6413) 2024-07-30 [email protected] [path_provider] fix 151823: update minimum required path_provider_android to 2.2.0 (flutter/packages#7181) 2024-07-30 [email protected] [shared_preferences] Platform implementations of async api (flutter/packages#6965) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
flutter/packages@99e8606...46a712f 2024-07-31 [email protected] [interactive_media_ads] Adds initial iOS implementation (flutter/packages#7063) 2024-07-31 49699333+dependabot[bot]@users.noreply.github.com [webview]: Bump androidx.annotation:annotation from 1.7.1 to 1.8.1 in /packages/webview_flutter/webview_flutter_android/android (flutter/packages#6770) 2024-07-31 49699333+dependabot[bot]@users.noreply.github.com [interactive_media_ads]: Bump androidx.annotation:annotation from 1.8.0 to 1.8.1 in /packages/interactive_media_ads/android (flutter/packages#7238) 2024-07-30 [email protected] [shared_preferences] full api redesign with DataStore and cache-less interface (flutter/packages#5210) 2024-07-30 49699333+dependabot[bot]@users.noreply.github.com [url_launcher]: Bump androidx.browser:browser from 1.5.0 to 1.8.0 in /packages/url_launcher/url_launcher_android/android (flutter/packages#6811) 2024-07-30 49699333+dependabot[bot]@users.noreply.github.com [in_app_pur]: Bump com.android.billingclient:billing from 6.1.0 to 6.2.0 in /packages/in_app_purchase/in_app_purchase_android/android (flutter/packages#6413) 2024-07-30 [email protected] [path_provider] fix 151823: update minimum required path_provider_android to 2.2.0 (flutter/packages#7181) 2024-07-30 [email protected] [shared_preferences] Platform implementations of async api (flutter/packages#6965) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
part 2 of #5210