-
Notifications
You must be signed in to change notification settings - Fork 6k
Let FlutterActivity/Fragment/FragmentActivity have an app bundle path override instead of eager resolving during construction #20769
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat. Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
6abde2f to
f1e50ed
Compare
| FlutterLoader mockFlutterLoader = mock(FlutterLoader.class); | ||
| when(mockFlutterLoader.findAppBundlePath()).thenReturn("default_flutter_assets/path"); | ||
| FlutterInjector.setInstance( | ||
| new FlutterInjector.Builder().setFlutterLoader(mockFlutterLoader).build()); |
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.
that other episode's so I can add this
| } | ||
|
|
||
| if (!FlutterInjector.instance().flutterLoader().initialized()) { | ||
| throw new AssertionError("Flutter UI can only be started once the Flutter engine's running."); |
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.
If users hit this, will they know what to do? Perhaps we can guide them to add-to-app guide or something?
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.
Actually I'll remove this check. Looking through the code, it's not actually possible to run into this situation through Flutter/Fragment/Activity either through builders or through subclassing and this class isn't public so it'll only affect tests.
… override instead of eager resolving during construction
965d741 to
4f34ee4
Compare
…dle path override instead of eager resolving during construction (flutter/engine#20769)
* 30b829e Populates fuchsia node actions in semantics updates. (flutter/engine#20451) * c2e7010 Roll Skia from 1ee21cdfb6fe to 6763a713f957 (1 revision) (flutter/engine#20982) * 841401d restore FML_DCHECK removed due to a code reviewing error (flutter/engine#20953) * 367c6db Don't use GetTaskQueueId() in rasterizer as it breaks Fuchsia (flutter/engine#20983) * b22a8c6 Let FlutterActivity/Fragment/FragmentActivity have an app bundle path override instead of eager resolving during construction (flutter/engine#20769) * 0f0ae68 Update test Dart code to pass the latest Dart analyzer rules (flutter/engine#20986) * d77dd31 Manual roll of Dart b29f228f62...016e8880f0 (flutter/engine#20967) * c7b3d53 Roll Fuchsia Mac SDK from gOI3W1UNU... to EN2ycWLxi... (flutter/engine#20985) * 6a6986d improve sensitivity of BackdropFilter web tests (flutter/engine#20915) * 9fc9cb2 Roll Dart SDK from 016e8880f0ab to 0f0cff3922ad (7 revisions) (flutter/engine#20990) * 242d522 [Android R] Sync keyboard animation with view insets vs Android 11/R/API 30 WindowInsetsAnimation (flutter/engine#20843) * b4e0896 Roll Fuchsia Linux SDK from 81O8Kg_Rw... to A0PKwETay... (flutter/engine#20998) * d77c4e5 adjust blur radius for HTML to match CanvasKit (flutter/engine#20840) * 0628492 Roll Dart SDK from 0f0cff3922ad to f3a9ca88b664 (1 revision) (flutter/engine#21000) * d1d848e Roll Fuchsia Mac SDK from EN2ycWLxi... to sih5f60Gt... (flutter/engine#20999)
|
Hello, has this been published in the dev pub? I am using the latest versions available today and I still have this problem. For me it only occurs when a notification arrives via firebase messaging and the app is closed |
|
Based on solved my problem, However, this should not be necessary after flutter 1.20 |
fixes flutter/flutter#64458
FlutterActivity and FlutterFragment are actually fine as is. Changing them too for consistency.
FlutterActivity doesn't expose the bundle path via Intent. FlutterFragment has a builder for override only and that doesn't resolve until after the FlutterFragment is created.
FlutterFragmentActivity tries to eager resolve to populate all the values of the FlutterFragment builder parameters.