Skip to content

Conversation

@gmackall
Copy link
Member

@gmackall gmackall commented Jan 22, 2025

Fixes #160945.

We should figure out why this stream usage is problematic. See the comment here #160945 (comment), that from what I can tell from Android docs it shouldn't be problematic. But it is causing crashes, and I think it is reasonable to change it so that it doesn't cause crashes, until we can figure out how to stop the crashes.

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@github-actions github-actions bot added platform-android Android applications specifically engine flutter/engine related. See also e: labels. labels Jan 22, 2025
@gmackall gmackall marked this pull request as ready for review January 22, 2025 20:09
@gmackall gmackall requested review from a team and reidbaker January 22, 2025 20:09
@gmackall
Copy link
Member Author

cc @matanlurey, as you were active on the original issue as well

@matanlurey
Copy link
Contributor

I personally would not make this change - streams have been in usage for a long time at this point, and there is nothing prohibiting us from introducing additional stream (or any de-sugared API), regressing the experience all over again. In other words, perhaps this fixes 1 particular problem for a subset of users, but it doesn't fix the underlying problem and perhaps even obfuscates it from us.

@gmackall
Copy link
Member Author

I personally would not make this change - streams have been in usage for a long time at this point, and there is nothing prohibiting us from introducing additional stream (or any de-sugared API), regressing the experience all over again. In other words, perhaps this fixes 1 particular problem for a subset of users, but it doesn't fix the underlying problem and perhaps even obfuscates it from us.

I agree it doesn't fix the larger problem, I'm also trying to do that separately. But we currently crash on a number of device/api levels that we claim to support, due to 1 trivial stream use. You don't think it's worth converting that to a different syntax while we attempt to solve the larger problem?

@matanlurey
Copy link
Contributor

matanlurey commented Jan 22, 2025

You don't think it's worth converting that to a different syntax while we attempt to solve the larger problem?

IMO, no, given the history.

We added this API in May 2022 (2ad3e5b), or approaching 3 calendar years from today. We have a serious problem if we can have a bug for 3 years, not detect it, and not know how to detect it, and I would put resources towards that instead of a particular crash (of which there might be more we just don't know about).

@matanlurey
Copy link
Contributor

In other words, solving this particular issue makes it no longer important to research further (and it goes to the bottom of the stack priority wise). If we are sure that won't happen (it almost always happens), then I'd say go for it with a TODO but you/Reid would know best and ultimately make the call.

@gmackall
Copy link
Member Author

We added this API in May 2022 (2ad3e5b), or approaching 3 calendar years from today. We have a serious problem if we can have a bug for 3 years, not detect it, and not know how to detect it, and I would put resources towards that instead of a particular crash (of which there might be more we just don't know about).

Agreed but also I think these require multiple different orders of magnitude of effort to solve, and aren't really substitutes for each other.

In other words, solving this particular issue makes it no longer important to research further (and it goes to the bottom of the stack priority wise). If we are sure that won't happen (it almost always happens), then I'd say go for it with a TODO but you/Reid would know best and ultimately make the call.

I agree this is a serious problem and should not drop to the bottom of the priority list just because 1 crash is fixed. The fact that it is serious is a large part of why I want to land a short term fix, though.

@reidbaker WDYT?

@reidbaker
Copy link
Contributor

@gmackall do you have a reproduction case that we have confirmed is fixed by this change? Or is this a best guess given the crash logs?

@gmackall
Copy link
Member Author

@gmackall do you have a reproduction case that we have confirmed is fixed by this change? Or is this a best guess given the crash logs?

This is a best guess, but also a pretty certain guess. I'm trying to reproduce the issue but have been unable. I may need to get my hands on a physical pixel 7 with Android 13

@reidbaker
Copy link
Contributor

@gmackall do you have a reproduction case that we have confirmed is fixed by this change? Or is this a best guess given the crash logs?

This is a best guess, but also a pretty certain guess. I'm trying to reproduce the issue but have been unable. I may need to get my hands on a physical pixel 7 with Android 13

Ok my thought is let this pr sit. Matan is correct that this usage is 3 years old which makes the fix less urgent. My worry is that the regression was not using this code but something else about our setup or tooling that happened more recently. If/when we get a reproduction case that will let us prove when the issue started.

We would land this change if we are not able to find a way to reproduce that way we are not dropping the priority of finding the root cause or how to protect against it.

In your attempts I would suggest creating an AAB then turning that into an apk. That is one of the differences between play store uploads and what we test.

@gmackall
Copy link
Member Author

gmackall commented Jan 23, 2025

My worry is that the regression was not using this code but something else about our setup or tooling that happened more recently. If/when we get a reproduction case that will let us prove when the issue started.

The reporter of #160945 is potentially experiencing it as a regression, but there are many others who have reported it further back (going back to 2023).
#141949
#148109

I am doubtful this is a new issue in 3.27

@reidbaker
Copy link
Contributor

@gmackall What it the plan with this pr?

@jesswrd
Copy link
Contributor

jesswrd commented Mar 11, 2025

from android triage: @johnmccutchan Would you rather land this without an investigation into the root cause or hold until the investigation is complete?

Copy link
Member

@jmagman jmagman left a comment

Choose a reason for hiding this comment

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

I vote we land this if this fixes a real problem users are hitting, whether or not further investigation is done. If this kind of odd speculative fix doesn't work then that's more information we don't currently have

@gmackall gmackall added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 25, 2025
@auto-submit
Copy link
Contributor

auto-submit bot commented Mar 25, 2025

autosubmit label was removed for flutter/flutter/162024, because - The status or check suite Linux plugin_test has failed. Please fix the issues identified (or deflake) before re-applying this label.

@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Mar 25, 2025
@gmackall gmackall added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 25, 2025
@auto-submit
Copy link
Contributor

auto-submit bot commented Mar 25, 2025

autosubmit label was removed for flutter/flutter/162024, because - The status or check suite Google testing has failed. Please fix the issues identified (or deflake) before re-applying this label.

@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Mar 25, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 27, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 27, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 27, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 28, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 28, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 28, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 28, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 29, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 29, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 30, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 30, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 31, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 31, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 31, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 31, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 31, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 31, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 31, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 1, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 1, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 1, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 1, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 20, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 20, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 21, 2025
zhangyuang pushed a commit to zhangyuang/flutter-fork that referenced this pull request Jun 9, 2025
Fixes flutter#160945.

We should figure out why this stream usage is problematic. See the
comment here
flutter#160945 (comment),
that from what I can tell from Android docs it _shouldn't_ be
problematic. But it is causing crashes, and I think it is reasonable to
change it so that it doesn't cause crashes, until we can figure out how
to stop the crashes.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

---------

Co-authored-by: Gray Mackall <[email protected]>
romanejaquez pushed a commit to romanejaquez/flutter that referenced this pull request Aug 14, 2025
Fixes flutter#160945.

We should figure out why this stream usage is problematic. See the
comment here
flutter#160945 (comment),
that from what I can tell from Android docs it _shouldn't_ be
problematic. But it is causing crashes, and I think it is reasonable to
change it so that it doesn't cause crashes, until we can figure out how
to stop the crashes.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

---------

Co-authored-by: Gray Mackall <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

engine flutter/engine related. See also e: labels. platform-android Android applications specifically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash Android release : FlutterView.sendUserSettingsToFlutter: java.lang.NoSuchMethodError when uploading to Play Store for review

6 participants