Skip to content

Upgrade Flutter, packages and Android build dependencies #1568

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

Merged
merged 12 commits into from
Jun 13, 2025

Conversation

rajveermalviya
Copy link
Member

Reverts #1562, and includes cherry-picked commits from Chris's #1546 for RadioGroup API migration.

@rajveermalviya rajveermalviya added the maintainer review PR ready for review by Zulip maintainers label Jun 12, 2025
Copy link
Member

@gnprice gnprice left a comment

Choose a reason for hiding this comment

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

Thanks for taking care of these! This all looks great, modulo two small comments below.

The #1545 fix will also need a few more changes now that #1517 has merged, as a sort of non-local merge conflict:
#1517 (comment)

Since it's fine for #1545 to wait until next week, and in the interest of getting the rest merged so it can go into a beta later today, I'll drop those three commits:
ccdacf9 Revert "settings [nfc]: Suppress some new deprecation warnings"
023f1e6 settings test: Check theme-setting radio buttons by checking what paints
ca3de6a settings: Migrate to new RadioGroup API for theme-setting radio buttons

and make the tweak for the other comment below. Then I'll go ahead and merge.

zulipLocalizations: zulipLocalizations)),
value: themeSettingOption,
// TODO(#1545) stop using the deprecated members
// ignore: deprecated_member_use
Copy link
Member

Choose a reason for hiding this comment

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

These ignores should get removed in the same commit that makes them no longer needed, rather than in a previous commit; otherwise the previous commit would enter a broken state.

Comment on lines -63 to +64
- FirebaseMessaging (11.10.0):
- FirebaseCore (~> 11.10.0)
- FirebaseMessaging (11.13.0):
- FirebaseCore (~> 11.13.0)
Copy link
Member

Choose a reason for hiding this comment

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

Notable change is Firebase iOS SDK bump to 11.13.0,
from 11.10.0, changelog for that is at:
  https://firebase.google.com/support/release-notes/ios

No notable change there for FCM (the only component we use).

By my reading, there's no change there at all, right? Not just no notable change.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, correct.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for confirming!

Comment on lines 1 to 12
<?xml version="1.0" encoding="UTF-8"?>
<issues format="6" by="lint 8.5.2" type="baseline" client="gradle" dependencies="false" name="AGP (8.5.2)" variant="all" version="8.5.2">
<issues format="6" by="lint 8.10.0" type="baseline" client="gradle" dependencies="false" name="AGP (8.10.0)" variant="all" version="8.10.0">

<!--TODO(#855) see if this is no longer needed-->
<issue
id="InvalidPackage"
message="Invalid package reference in library; not included in Android: `javax.xml.stream`. Referenced from `org.apache.tika.utils.XMLReaderUtils`.">
<location
file="$GRADLE_USER_HOME/caches/modules-2/files-2.1/org.apache.tika/tika-core/3.1.0/6ba44a9ddf8f6f2b4bc88e8bc64269aea0424607/tika-core-3.1.0.jar"/>
file="$GRADLE_USER_HOME/caches/modules-2/files-2.1/org.apache.tika/tika-core/3.2.0/9232bb3c71f231e8228f570071c0e1ea29d40115/tika-core-3.2.0.jar"/>
</issue>

</issues>
Copy link
Collaborator

@chrisbobbe chrisbobbe Jun 12, 2025

Choose a reason for hiding this comment

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

deps: Update file_picker to 10.2.0, from 10.1.9

I'm not following why the lint-baseline changes are necessary. At this commit, for me, tools/check android still fails with a similar-looking lint with what looks like the original location string (…3.2.0/9232bb…). Is there a command I should run?

Copy link
Collaborator

@chrisbobbe chrisbobbe Jun 12, 2025

Choose a reason for hiding this comment

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

I tried ./gradlew clean and rm -rf .gradle (after cd android) and reran; same result.

Copy link
Member

Choose a reason for hiding this comment

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

Hmm interesting. 3.2.0/9232bb… is the new location string, though, right?

Do you get the same failure in main?

Copy link
Collaborator

Choose a reason for hiding this comment

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

[…] is the new location string, though, right?

Er oops, I think I copy-pasted from the wrong thing (the lint report showed two things (1) a suppression that wasn't used because nothing matched, and (2) an error that wasn't caught by a suppression, and they looked very similar).

Anyway, it's passing now; not sure what changed 🤷‍♂️ :

Lint found no errors or warnings

1 errors/warnings were listed in the baseline file (/Users/chrisbobbe/dev/zulip-flutter/android/app/lint-baseline.xml) but not found in the project; perhaps they have been fixed?

Note: The baseline was created using a different target/variant than it was checked against.
Creation variant: lint
Current variant: lintVitalRelease

Copy link
Collaborator

@chrisbobbe chrisbobbe Jun 12, 2025

Choose a reason for hiding this comment

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

(So, LGTM; there's a "Note" there that we might investigate if there were time, but it doesn't seem to be about something broken.)

Copy link
Member

Choose a reason for hiding this comment

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

Sounds good; thanks for checking into it!

@gnprice gnprice force-pushed the pr-flutter-upgrade branch from 0b95650 to 8c846f5 Compare June 13, 2025 00:22
And update Flutter's supporting libraries to match.
Without this change, `flutter run` prints the following
warning message:

  /…/zulip-flutter/l10n.yaml: The argument "synthetic-package" no
  longer has any effect and should be removed. See
  http://flutter.dev/to/flutter-gen-deprecation
Changelog:
  https://pub.dev/packages/flutter_lints/changelog#600

Also includes changes to fix lint failures for the new
'unnecessary_underscores' lint, probably to encourage using
wildcard variable `_`:
  https://dart.dev/language/variables#wildcard-variables

Without this change `flutter analyze` reports the following:

   info • Unnecessary use of multiple underscores • lib/widgets/autocomplete.dart:133:40 • unnecessary_underscores
   info • Unnecessary use of multiple underscores • lib/widgets/autocomplete.dart:156:38 • unnecessary_underscores
   info • Unnecessary use of multiple underscores • lib/widgets/autocomplete.dart:156:42 • unnecessary_underscores
   info • Unnecessary use of multiple underscores • lib/widgets/emoji_reaction.dart:333:34 • unnecessary_underscores
This commit is result of following commands:
  flutter pub upgrade --major-versions firebase_messaging firebase_core
  pod update --project-directory=ios/
  pod update --project-directory=macos/

Changelogs:
  https://pub.dev/packages/firebase_core/changelog#3140
  https://pub.dev/packages/firebase_messaging/changelog#1527

Notable change is Firebase iOS SDK bump to 11.13.0,
from 11.10.0, changelog for that is at:
  https://firebase.google.com/support/release-notes/ios

No changes there for FCM (the only component we use).
@gnprice gnprice force-pushed the pr-flutter-upgrade branch from 8c846f5 to 2ff1abe Compare June 13, 2025 00:29
@gnprice
Copy link
Member

gnprice commented Jun 13, 2025

Made those changes, and rebased resolving conflicts. I'll let CI run on the result before merging.

@chrisbobbe
Copy link
Collaborator

The CI failures are drift and pigeon; perhaps conflicts with the now-merged #1517 (which adds a setting) and #1379?

@gnprice
Copy link
Member

gnprice commented Jun 13, 2025

Hmm, thanks. Running this now:
$ git rebase -i -x 'tools/check --fix --all-files drift pigeon'
(and using the -i to delete the tools/check steps after commits that seem like they couldn't be affected)

Changelog:
  https://pub.dev/packages/dart_style/changelog#310

This commit was produced by editing pubspec.yaml, then:
  $ flutter pub get
  $ ./tools/check --all-files --fix build_runner l10n drift pigeon
Changelog:
  https://pub.dev/packages/file_picker/changelog#1020

One bug fix on Android, for `saveFile`, which we don't use.

Also, update lint-baseline.xml using `gradlew updateLintBaseline`.
The latest version (2.10.0) makes significant changes internally
and to the test API, which would require us to investigate and
update our FakeVideoPlayerPlatform mock for tests.

So, pin to the currently used version for now.
@gnprice gnprice force-pushed the pr-flutter-upgrade branch from 2ff1abe to 3ef9de6 Compare June 13, 2025 01:20
@gnprice
Copy link
Member

gnprice commented Jun 13, 2025

OK, that command fixed it for Drift.

For Pigeon… it ended up actually reverting the changes (which are only to the Pigeon version number written at the top of the file) in the two files that were already updated in that commit:
android/app/src/main/kotlin/com/zulip/flutter/AndroidNotifications.g.kt
lib/host/android_notifications.g.dart

As we've seen a couple of times before, it seems like there's some unfortunate caching going on in the Pigeon generator, or perhaps in build_runner underneath it.

So I just edited the affected file directly to bump that version number.

Let's see how CI goes on this version.

@chrisbobbe
Copy link
Collaborator

#622?

@gnprice
Copy link
Member

gnprice commented Jun 13, 2025

Yeah, that looks like it — thanks for pulling it up.

@chrisbobbe
Copy link
Collaborator

Looks like CI passed! Please merge at will.

@gnprice gnprice merged commit 3ef9de6 into zulip:main Jun 13, 2025
1 check passed
@rajveermalviya rajveermalviya deleted the pr-flutter-upgrade branch June 13, 2025 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintainer review PR ready for review by Zulip maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants