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

[camera] iOS and Android registerWith trigger method channels setup before binding initialization #106236

Closed
SakurasDuck opened this issue Jun 18, 2022 · 25 comments · Fixed by flutter/plugins#6009
Assignees
Labels
c: regression It was better in the past than it is now p: camera The camera plugin P1 High-priority issues at the top of the work list package flutter/packages repository. See also p: labels.

Comments

@SakurasDuck
Copy link

SakurasDuck commented Jun 18, 2022

camera_android: 0.9.8+1

flutter doctor -v

[√] Flutter (Channel stable, 3.0.2, on Microsoft Windows [Version 10.0.19044.1766], locale zh-CN)
• Flutter version 3.0.2 at D:\Tools\Android\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision cd41fdd (10 days ago), 2022-06-08 09:52:13 -0700
• Engine revision f15f824b57
• Dart version 2.17.3
• DevTools version 2.12.2
• Pub download mirror http://pub.lan.wiqun.com
• Flutter download mirror https://storage.flutter-io.cn

Checking Android licenses is taking an unexpectedly long time...[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at D:\Tools\Android\SDK
• Platform android-32, build-tools 30.0.3
• ANDROID_HOME = D:\Tools\Android\SDK
• Java binary at: C:\Users\Pawn\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-0\202.7322048\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6842174)
• All Android licenses accepted.

[√] Chrome - develop for the web
• Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.9.4)
• Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
• Visual Studio Community 2019 version 16.9.31205.134
• Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 4.2)
• Android Studio at C:\Users\Pawn\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-0\202.7322048
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6842174)

[√] IntelliJ IDEA Community Edition (version 2020.3)
• IntelliJ at C:\Users\Pawn\AppData\Local\JetBrains\Toolbox\apps\IDEA-C\ch-0\203.6682.168
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart

[√] IntelliJ IDEA Community Edition (version 2021.1)
• IntelliJ at C:\Users\Pawn\AppData\Local\JetBrains\Toolbox\apps\IDEA-C\ch-0\211.7628.21
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart

[√] VS Code (version 1.68.1)
• VS Code at C:\Users\Pawn\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.42.0

[√] Connected device (4 available)
• LND AL40 (mobile) • 3SLBB18414213204 • android-arm64 • Android 8.0.0 (API 26)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19044.1766]
• Chrome (web) • chrome • web-javascript • Google Chrome 102.0.5005.115
• Edge (web) • edge • web-javascript • Microsoft Edge 102.0.1245.41

[√] HTTP Host Availability
• All required HTTP hosts are available

• No issues found!

Logs

AndroidCamera.registerWith (package:camera_android/src/android_camera.dart:32:66)
I/flutter ( 1198): #1 _PluginRegistrant.register (file:///xxxx/.dart_tool/flutter_build/dart_plugin_registrant.dart:36:23)
I/flutter ( 1198): camera_android threw an error: Binding has not yet been initialized.
I/flutter ( 1198): The "instance" getter on the ServicesBinding binding mixin is only available once that binding has been initialized.
I/flutter ( 1198): Typically, this is done by calling "WidgetsFlutterBinding.ensureInitialized()" or "runApp()" (the latter calls the former). Typically this call is done in the "void main()" method. The "ensureInitialized" method is idempotent; calling it multiple times is not harmful. After calling that method, the "instance" getter will return the binding.
I/flutter ( 1198): In a test, one can call "TestWidgetsFlutterBinding.ensureInitialized()" as the first line in the test's "main()" method to initialize the binding.
I/flutter ( 1198): If ServicesBinding is a custom binding mixin, there must also be a custom binding class, like WidgetsFlutterBinding, but that mixes in the selected binding, and that is the class that must be constructed before using the "instance" getter.. The app may not function as expected until you remove this plugin from pubspec.yaml
E/flutter ( 1198): [ERROR:flutter/shell/common/shell.cc(93)] Dart Unhandled Exception: Binding has not yet been initialized.
E/flutter ( 1198): The "instance" getter on the ServicesBinding binding mixin is only available once that binding has been initialized.
E/flutter ( 1198): Typically, this is done by calling "WidgetsFlutterBinding.ensureInitialized()" or "runApp()" (the latter calls the former). Typically this call is done in the "void main()" method. The "ensureInitialized" method is idempotent; calling it multiple times is not harmful. After calling that method, the "instance" getter will return the binding.
E/flutter ( 1198): In a test, one can call "TestWidgetsFlutterBinding.ensureInitialized()" as the first line in the test's "main()" method to initialize the binding.
E/flutter ( 1198): If ServicesBinding is a custom binding mixin, there must also be a custom binding class, like WidgetsFlutterBinding, but that mixes in the selected binding, and that is the class that must be constructed before using the "instance" getter., stack trace: #0 BindingBase.checkInstance. (package:flutter/src/foundation/binding.dart:281:9)
E/flutter ( 1198): #1 BindingBase.checkInstance (package:flutter/src/foundation/binding.dart:363:6)
E/flutter ( 1198): #2 ServicesBinding.instance (package:flutter/src/services/binding.dart:48:54)
E/flutter ( 1198): #3 MethodChannel.setMethodCallHandler (package:flutter/src/services/platform_channel.dart:387:51)
E/flutter ( 1198): #4 new AndroidCamera (package:camera_android/src/android_camera.dart:26:13)
E/flutter ( 1198): #5 AndroidCamera.registerWith (package:camera_android/src/android_camera.dart:33:31)
E/flutter ( 1198): #6 _PluginRegistrant.register (file:///xxxx/.dart_tool/flutter_build/dart_plugin_registrant.dart:36:23)
E/flutter ( 1198):

I can't run WidgetsFlutterBinding.ensureInitialized() before camera_android'sregisterWith(), plz fix it !

@SakurasDuck
Copy link
Author

SakurasDuck commented Jun 18, 2022

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  ...
}

It doesn't work either

@masewo
Copy link

masewo commented Jun 18, 2022

Regression. After upgrading camera_android and camera_avfoundation from 0.9.7+1 to 0.9.8+1 my app does not start anymore.

@DenisMrGnusa
Copy link

same error, i was trying to use version ^0.9.7+1 and ^0.9.8+1, but not luck.

this my flutter spec:
Flutter is already up to date on channel stable
Flutter 3.0.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision cd41fdd (10 days ago) • 2022-06-08 09:52:13 -0700
Engine • revision f15f824b57
Tools • Dart 2.17.3 • DevTools 2.12.2

@masewo
Copy link

masewo commented Jun 18, 2022

Use this in your pubspec.yaml:

dependency_overrides:
  camera_android: 0.9.7+1
  camera_avfoundation: 0.9.7+1

@ufogxl
Copy link

ufogxl commented Jun 18, 2022

your solution saves my day! could you please tell the reason?

Use this in your pubspec.yaml:

dependency_overrides:
  camera_android: 0.9.7+1
  camera_avfoundation: 0.9.7+1

@SakurasDuck
Copy link
Author

look this:

AndroidCamera.registerWith (package:camera_android/src/android_camera.dart:32:66)
I/flutter ( 1198): #1 _PluginRegistrant.register (file:///xxxx/.dart_tool/flutter_build/dart_plugin_registrant.dart:36:23)

I print stack in my app,and i find thisIMG20220618235534.jpg
Didn't work as expected???

@stuartmorgan
Copy link
Contributor

This is an unintended side effect of moving to a per-package platform channel. The default method channel didn't have this problem because static class fields are lazily evaluated in Dart, so the default method channel class constructor was only being run once the camera is actually used, whereas the new version's constructors are explicitly triggered in registerWith().

We'll need to make the reverse channel creation lazy in those implementations, rather than setting it up in the constructor.

@stuartmorgan stuartmorgan added c: regression It was better in the past than it is now plugin p: camera The camera plugin P1 High-priority issues at the top of the work list labels Jun 18, 2022
@stuartmorgan stuartmorgan self-assigned this Jun 18, 2022
@stuartmorgan stuartmorgan changed the title camera_android 0.9.8+1 registerWith() made a big mistake [camera] iOS and Android registerWith trigger method channels setup before binding initialization Jun 18, 2022
@stuartmorgan
Copy link
Contributor

@SakurasDuck In the future, please don't ping random people in issue reports.

@SakurasDuck
Copy link
Author

@stuartmorgan sorry,never again

@bhanuka96
Copy link

Same Issue, Any Updates

I/flutter ( 6677): `camera_android` threw an error: Binding has not yet been initialized.
I/flutter ( 6677): The "instance" getter on the ServicesBinding binding mixin is only available once that binding has been initialized.
I/flutter ( 6677): Typically, this is done by calling "WidgetsFlutterBinding.ensureInitialized()" or "runApp()" (the latter calls the former). Typically this call is done in the "void main()" method. The "ensureInitialized" method is idempotent; calling it multiple times is not harmful. After calling that method, the "instance" getter will return the binding.
I/flutter ( 6677): In a test, one can call "TestWidgetsFlutterBinding.ensureInitialized()" as the first line in the test's "main()" method to initialize the binding.
I/flutter ( 6677): If ServicesBinding is a custom binding mixin, there must also be a custom binding class, like WidgetsFlutterBinding, but that mixes in the selected binding, and that is the class that must be constructed before using the "instance" getter.. The app may not function as expected until you remove this plugin from pubspec.yaml
E/flutter ( 6677): [ERROR:flutter/shell/common/shell.cc(93)] Dart Unhandled Exception: Binding has not yet been initialized.
E/flutter ( 6677): The "instance" getter on the ServicesBinding binding mixin is only available once that binding has been initialized.
E/flutter ( 6677): Typically, this is done by calling "WidgetsFlutterBinding.ensureInitialized()" or "runApp()" (the latter calls the former). Typically this call is done in the "void main()" method. The "ensureInitialized" method is idempotent; calling it multiple times is not harmful. After calling that method, the "instance" getter will return the binding.
E/flutter ( 6677): In a test, one can call "TestWidgetsFlutterBinding.ensureInitialized()" as the first line in the test's "main()" method to initialize the binding.
E/flutter ( 6677): If ServicesBinding is a custom binding mixin, there must also be a custom binding class, like WidgetsFlutterBinding, but that mixes in the selected binding, and that is the class that must be constructed before using the "instance" getter., stack trace: #0      BindingBase.checkInstance.<anonymous closure> (package:flutter/src/foundation/binding.dart:281:9)
E/flutter ( 6677): #1      BindingBase.checkInstance (package:flutter/src/foundation/binding.dart:363:6)
E/flutter ( 6677): #2      ServicesBinding.instance (package:flutter/src/services/binding.dart:48:54)
E/flutter ( 6677): #3      MethodChannel.setMethodCallHandler (package:flutter/src/services/platform_channel.dart:387:51)
E/flutter ( 6677): #4      new AndroidCamera (package:camera_android/src/android_camera.dart:26:13)
E/flutter ( 6677): #5      AndroidCamera.registerWith (package:camera_android/src/android_camera.dart:32:31)
E/flutter ( 6677): #6      _PluginRegistrant.register (file:///Users/bhanukaisuru/Documents/REBORN/YELLO/user-app/.dart_tool/flutter_build/dart_plugin_registrant.dart:47:23)
E/flutter ( 6677): 

@bhanuka96
Copy link

Temp Solution:

Downgrade the plugin to 0.9.7+1

camera: 0.9.7+1

@islom9797
Copy link

islom9797 commented Jun 20, 2022

Use this in your pubspec.yaml:

dependency_overrides:
  camera_android: 0.9.7+1
  camera_avfoundation: 0.9.7+1

also helped me .I add camera and this packege at the same time to pubspec.yalm and worked me thanks

@ayansg
Copy link

ayansg commented Jun 21, 2022

This is an unintended side effect of moving to a per-package platform channel. The default method channel didn't have this problem because static class fields are lazily evaluated in Dart, so the default method channel class constructor was only being run once the camera is actually used, whereas the new version's constructors are explicitly triggered in registerWith().

We'll need to make the reverse channel creation lazy in those implementations, rather than setting it up in the constructor.

Just a note on regression, path_provider package also stops working after this error is thrown. It fails to get the platform specific channel and throws a MissingPluginException whenever a platform directory is requested. You should also be adding this to your regression testing.

@RaistlinTAO
Copy link

RaistlinTAO commented Jun 21, 2022

Temp Solution:

Downgrade the plugin to 0.9.7+1

camera: 0.9.7+1

Downgrading the plugin seems still not working, using override method.

And shared_preferences is also broken if not overrided.

[ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: MissingPluginException(No implementation found for method getAll on channel plugins.flutter.io/shared_preferences)

@bhanuka96
Copy link

Temp Solution:
Downgrade the plugin to 0.9.7+1
camera: 0.9.7+1

Downgrading the plugin seems still not working, using override method.

And shared_preferences is also broken if not overrided.

[ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: MissingPluginException(No implementation found for method getAll on channel plugins.flutter.io/shared_preferences)

downgrade plugin and then delete pubspec.lock file and run pub get

@stuartmorgan
Copy link
Contributor

Any plugin that comes alphabetically after camera and that uses Dart plugin registration will be broken if the camera exception is thrown; that will be fixed on the Flutter side separately from the camera issue itself (#106322).

@AlexV525
Copy link
Member

Should we increase the priority since multiple plugins are affected by the regression?

stuartmorgan added a commit to stuartmorgan/plugins that referenced this issue Jun 21, 2022
Fixes a regression from an unintented change in behavior during the
conversion to an in-app method channel for Android and iOS. Although the
Dart code for their implementations is almost identical to the shared
method channel version, the differences in initialization paths caused
the platform versions to try to use the widget bindings before they had
been set up: The constructor for a `dartPluginClass` is called during
`registerWith`, which is before `main`, but the constructor for the
default implementation isn't called until `CameraPlatform.instance` is
called, since Dart automatically does lazy static class initializtion.

To avoid the issue without forcing bindings to be initialized early,
this makes setting up the platform channel listener lazily.

Fixes flutter/flutter#106236
stuartmorgan added a commit to flutter/plugins that referenced this issue Jun 21, 2022
Fixes a regression from an unintented change in behavior during the
conversion to an in-app method channel for Android and iOS. Although the
Dart code for their implementations is almost identical to the shared
method channel version, the differences in initialization paths caused
the platform versions to try to use the widget bindings before they had
been set up: The constructor for a `dartPluginClass` is called during
`registerWith`, which is before `main`, but the constructor for the
default implementation isn't called until `CameraPlatform.instance` is
called, since Dart automatically does lazy static class initializtion.

To avoid the issue without forcing bindings to be initialized early,
this makes setting up the platform channel listener lazily.

Fixes flutter/flutter#106236
@BytesZero

This comment was marked as off-topic.

@stuartmorgan
Copy link
Contributor

You should not use dependency_overrides to get the latest version of packages; what you have shown there would prevent ever getting any new updates to the camera implementations.

You should instead remove any pinning from pubspec.yaml, then flutter pub upgrade.

@BytesZero
Copy link

BytesZero commented Jun 22, 2022

您不应该使用dependency_overrides来获取最新版本的软件包;您在那里展示的内容将阻止对相机实现进行任何新的更新。

您应该改为从pubspec.yaml, 然后删除任何固定flutter pub upgrade

The reason is that I really want to use a definite version, so as not to bring unnecessary trouble, I have crashes on both Android and iOS, my camera is the fixed version 0.9.8, and it turns out that camera_android and camera_avfoundation have no definite version.

So if you want to follow the upgrade then use flutter pub upgrade

@AlexV525
Copy link
Member

So if you want to follow the upgrade then use dependency_overrides

@yy1300326388 Please don't use dependency_overrides if you want to follow up further upgrades as @stuartmorgan mentioned. It only helps with two cases typically:

  • Debugging with a local version, then overrides with a local one.
  • Some breaking changes happened without proper semantics version updates and you need to stick with old APIs.

Other than that, use flutter pub upgrade.

@BytesZero
Copy link

Yes, I am currently the second case, and I also do not recommend using dependency_overrides
I will regularly check the upgrade and verify the relevant stability before upgrading. Generally, I will use a definite version

@stuartmorgan
Copy link
Contributor

stuartmorgan commented Jun 22, 2022

The combination of pubspec.yaml (for constraints) and pubspec.lock (to keep specific versions until you intentionally upgrade them) already allow you to use specific versions. And it does so without breaking normal workflows like upgrade.

If you personally want to follow anti-patterns like routinely force-pinning exact versions of your transitive dependencies you certainly can, but please don't tell people to do it in our issue tracker as a way of updating packages--especially without any context that would alert newer community members to the future problems it would cause (like never getting bugfixes to those packages again).

@BytesZero
Copy link

Ok, I have edited, thanks for the patient guidance ❤️

@github-actions
Copy link

github-actions bot commented Jul 6, 2022

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 6, 2022
renfelo added a commit to peggyart/plugins that referenced this issue Jul 14, 2022
* Roll Flutter from e291b58 to e9c0ee1 (1 revision) (flutter#5616)

* Roll Flutter from e9c0ee1 to b3838eb (1 revision) (flutter#5617)

* Roll Flutter from b3838eb to b5321d1 (1 revision) (flutter#5618)

* [camera] Update mocktail to latest. (flutter#5614)

* Roll Flutter from b5321d1 to 82b91b0 (8 revisions) (flutter#5626)

* Roll Flutter from 82b91b0 to 3c9f417 (2 revisions) (flutter#5629)

* Roll Flutter from 3c9f417 to 2e1c146 (4 revisions) (flutter#5630)

* Roll Flutter from 2e1c146 to 122ab83 (1 revision) (flutter#5631)

* Roll Flutter from 122ab83 to 051f1b0 (1 revision) (flutter#5632)

* Roll Flutter from 051f1b0 to 35513c2 (1 revision) (flutter#5633)

* Roll Flutter from 35513c2 to f7db489 (1 revision) (flutter#5634)

* Roll Flutter from f7db489 to 0ea21bc (12 revisions) (flutter#5637)

* Roll Flutter from 0ea21bc to f771c9f (1 revision) (flutter#5638)

* [github workflow] Resolve token-permissions security alerts (flutter#5627)

* Roll Flutter from f771c9f to 0a26277 (3 revisions) (flutter#5641)

* Roll Flutter from 0a26277 to 603eb82 (1 revision) (flutter#5644)

* Roll Flutter from 603eb82 to 758ebda (6 revisions) (flutter#5646)

* Roll Flutter from 758ebda to 2f3f053 (5 revisions) (flutter#5648)

* 543cc60 Roll Engine from 387a9b9e300f to b1b0a5adffe9 (1 revision) (flutter/flutter#103159)

* 55881f7 Reland "Fix crash from alt-tab'ing just after startup"  (flutter/flutter#103093)

* 82afe3e Clear the cached data of `RenderBox` if its parent re-layout (flutter/flutter#101493)

* b20e27e Does not replace the root layer unnecessarily (flutter/flutter#101748)

* 2f3f053 Roll Engine from b1b0a5adffe9 to 47c8a6acf9f3 (1 revision) (flutter/flutter#103164)

* Add issues/PRs badges to README (flutter#5649)

* Roll Flutter from 2f3f053 to ac30842 (13 revisions) (flutter#5650)

* Roll Flutter from ac30842 to e571835 (4 revisions) (flutter#5652)

* [local_auth] Overhaul README, and fix `error_codes.dart` visibility (flutter#5653)

* Roll Flutter from e571835 to 47f48e4 (5 revisions) (flutter#5654)

* Roll Flutter from 47f48e4 to 8e532db (1 revision) (flutter#5655)

* Roll Flutter from 8e532db to cc9ac07 (1 revision) (flutter#5656)

* Roll Flutter from cc9ac07 to f56c0b3 (1 revision) (flutter#5657)

* Roll Flutter from f56c0b3 to d01b0f5 (1 revision) (flutter#5658)

* Roll Flutter from d01b0f5 to b05b44e (3 revisions) (flutter#5660)

* Roll Flutter from b05b44e to 90868d3 (3 revisions) (flutter#5662)

* Roll Flutter from 90868d3 to ae7fcc7 (2 revisions) (flutter#5663)

* Roll Flutter from ae7fcc7 to c180971 (1 revision) (flutter#5664)

* Roll Flutter from c180971 to c6ced84 (2 revisions) (flutter#5665)

* Roll Flutter from c6ced84 to 4bed767 (1 revision) (flutter#5666)

* Enable lints `library_private_types_in_public_api`, `sort_child_properties_last` and `use_key_in_widget_constructors` (flutter#5428)

* Revert "Enable lints `library_private_types_in_public_api`, `sort_child_properties_last` and `use_key_in_widget_constructors`" (flutter#5691)

This reverts commit 4b7b679.

This includes a fix for a latent bug in the version-check repo tooling command that caused it to fail when reverting a package that previously had a NEXT section, so that tests will pass.

* Re-land: Enable lints `library_private_types_in_public_api`, `sort_child_properties_last` and `use_key_in_widget_constructors` (flutter#5692)

Re-lands flutter#5428

This is a revert of flutter#5691 (the revert of the above) with the following changes:
- Excludes the repo tooling changes that had to be added to the revert, since we want those
- Fixes local_auth:
    - Updates code for the new analysis failure
    - Fixes the bad version merge that dropped the version change
- Reverts a version change in `file_selector_platform_interface`, which didn't otherwise change

* [webview_flutter_wkwebview] The rest of the Objective-C HostApi methods  (flutter#5604)

* Roll Flutter from 4bed767 to df7111a (42 revisions) (flutter#5696)

* Re-sync analysis_options.yaml with flutter/flutter (flutter#5695)

The analysis options have gotten behind; this re-syncs to the current state of flutter/flutter. For options that are non-trivial to enable, either because they are non-trivial to fix, or touch a very large number of files, they are locally disabled with clear "LOCAL CHANGE" markers so that it's obvious where we are out of sync. For options that are simple to resolve, they are enabled in the PR.

Part of flutter/flutter#76229

* [camera] Fix preview pause orientation (flutter#5209)

* [google_sign_in] Add forceCodeForRefreshToken parameter (and new SignInInitParameters class) (flutter#5325)

* [image_picker] add requestFullMetadata for iOS (optional permissions) - platform interface (flutter#5603)

* [google_sign_in] Fix tests to recognize new request attribute. (flutter#5702)

* Roll Flutter from df7111a to a9ac7fb (2 revisions) (flutter#5697)

* [ios_platform_images] Ignore ImageProvider.load deprecation. (flutter#5701)

* [image_picker] Switch unit tests to mock plaform implementation (flutter#5706)

`image_picker`'s app-facing tests were never updated during federation to
use a mock platform implementation, and instead were still mocking method
channels. That makes them fragile to implementation details of the
default method channel implementation that is part of another package,
and thus subject to breakage when the method channel changes.

This converts them to using a mock platform implementation, so it's only
testing the layer within this package.

Removes some tests that were testing things that only made sense at the
method channel layer.

Adds argument assertions that there were tests for, but were previously
only enforced in the implementations. As these are API constraints, they
should be enforced at the API layer, not at each implementation's layer
as they currently are.

* [google_sign_in] Switch unit tests to mock platform implementation (flutter#5703)

* [ios_platform_images] Ignore ImageProvider.load deprecation (flutter#5707)

* Roll Flutter from a9ac7fb to 8bec125 (38 revisions) (flutter#5704)

* Roll Flutter from 8bec125 to 6bba577 (17 revisions) (flutter#5709)

* Roll Flutter from 6bba577 to b3d7a69 (1 revision) (flutter#5710)

* Roll Flutter from b3d7a69 to c13bc34 (2 revisions) (flutter#5715)

* [ci] Update the legacy analysis versions (flutter#5699)

* Roll Flutter from c13bc34 to ac80477 (2 revisions) (flutter#5717)

* Roll Flutter from ac80477 to 2b2cda1 (2 revisions) (flutter#5719)

* [tools] Fix `publish` flag calculation (flutter#5694)

* [camera]handle iOS camera access permission (flutter#5215)

* [image_picker] Fix 'messages.g.h' file not found (flutter#5635)

* [ci] Manually roll Flutter master (flutter#5765)

* Roll Flutter from 036cae3 to bf7a326 (49 revisions) (flutter#5768)

* Roll Flutter from bf7a326 to bb9bbc6 (1 revision) (flutter#5769)

* Roll Flutter from bb9bbc6 to fd312f1 (1 revision) (flutter#5770)

* Roll Flutter from fd312f1 to c248854 (1 revision) (flutter#5771)

* [in_app_purchase] fixed a memory leak error (flutter#5358)

* [local_auth] Windows support. (flutter#4806)

* [google_sign_in_platform_interface] Add availability to mock models (flutter#5669)

* Update cirrus secret. (flutter#5774)

* Add more Android plugin owners (flutter#5624)

* [google_maps_flutter] Fix native unit tests on M1 (flutter#5772)

* [video_player]: Bump exoplayer from 2.17.0 to 2.17.1 in /packages/video_player/video_player_android/android (flutter#5579)

* [tools] Validate example READMEs (flutter#5775)

* [webview_flutter] Initial v4.0 platform interface implementation  (flutter#5109)

* [camera] Request access permission for audio (flutter#5766)

* Roll Flutter from c248854 to 1994027 (1 revision) (flutter#5777)

* [ci/tools] Add iOS/macOS analysis to catch deprecated code (flutter#5778)

* Add more CODEOWNERS (flutter#5779)

* [tools] Add `update-release-info` (flutter#5643)

* [local_auth] Adds federated Windows support (flutter#5776)

* [google_sign_in] Upgrade to GoogleSignIn 6.2, support arm64 simulators (flutter#5708)

* Roll Flutter from 1994027 to a4a8e73 (31 revisions) (flutter#5782)

* [ci] Updates iOS deprecation check to iOS 13 (flutter#5786)

* [various] Set minimum Flutter versions to 2.8 (flutter#5792)

* [google_maps_flutter_web] Remove custom analysis file. (flutter#5791)

* [path_provider] Fix integration tests on macOS (flutter#5773)

* [video_player] Fix order-dependent tests (flutter#5672)

* [google_sign_in] Suppress `deprecation` warnings (flutter#5049)

* Roll Flutter from a4a8e73 to 1e1f4bc (65 revisions) (flutter#5795)

* Roll Flutter from 1e1f4bc to 1e10cec (6 revisions) (flutter#5799)

* Roll Flutter from 1e10cec to 6aaabf6 (1 revision) (flutter#5800)

* Roll Flutter from 6aaabf6 to 4654fd0 (2 revisions) (flutter#5802)

* Roll Flutter from 4654fd0 to b8b0c80 (1 revision) (flutter#5803)

* Roll Flutter from b8b0c80 to de7c23e (1 revision) (flutter#5804)

* Roll Flutter from de7c23e to ec20ea8 (1 revision) (flutter#5805)

* [google_sign_in, in_app_purchase_android] Add availability to mock models (flutter#5642)

* [Camera] Return all possible cameras on iOS (flutter#5636)

* [google_maps_flutter] Updates platform interface to new analysis options (flutter#5793)

* [google_maps_flutter] Fix prefer_const_literals_to_create_immutables (flutter#5811)

* Roll Flutter from ec20ea8 to 7ece8f9 (3 revisions) (flutter#5813)

* Roll Flutter from 7ece8f9 to f852092 (5 revisions) (flutter#5815)

* Roll Flutter from f852092 to 9398c14 (3 revisions) (flutter#5817)

* Roll Flutter from 9398c14 to 35c0a3e (9 revisions) (flutter#5821)

* [ci] Initial migration to Cirrus Apple silicon (flutter#5794)

* Roll Flutter from 35c0a3e to 7ca4984 (3 revisions) (flutter#5823)

* Roll Flutter from 7ca4984 to e4c7f6e (4 revisions) (flutter#5824)

* Roll Flutter from e4c7f6e to ac29c11 (1 revision) (flutter#5826)

* Fix issue where map updates don't take effect in Flutter v3.0.0 (flutter#5787)

* Roll Flutter from ac29c11 to efb9368 (3 revisions) (flutter#5827)

* [ios_platform_images] ignore DecoderCallback deprecation (flutter#5806)

* Roll Flutter from efb9368 to b5adbee (10 revisions) (flutter#5830)

* [camera] Move camera streaming to platform interface (flutter#5783)

* Roll Flutter from b5adbee to da24f10 (10 revisions) (flutter#5832)

* [webview_flutter_wkwebview] Update variable names for changes coming in flutter#5700 (flutter#5829)

* Roll Flutter from da24f10 to e899573 (15 revisions) (flutter#5834)

* [camera] Switch to platform-interface-provided streaming (flutter#5833)

* [webview]: Bump gradle from 3.3.0 to 7.2.1 in /packages/webview_flutter/webview_flutter_android/android (flutter#5842)

* [webview_flutter_wkwebview] Raise minimum Dart and Flutter version to 2.17 and 3.0.0, respectively. (flutter#5850)

* [path_provider] Support unicode encoded version info values (flutter#4986)

* [camera_web] Use CameraAccessDenied for permission error (flutter#5784)

* [path_provider_windows] Update to ffi 2.0.0 (flutter#5853)

* Use Win32 type aliases

* Generated file update

* Bump version

* Bump pub dependency in path_provider_linux

* Add integration_test dev dependency

* Revert "Add integration_test dev dependency"

This reverts commit 40e7778.

* Address review comments

* [video_player] Android: video_player_android parts of rotationCorrection fix (flutter#5158)

* [google_maps_flutter] Objective-C code clean up (flutter#5780)

* All the workflows have been migrated to use main. (flutter#5874)

Master branch is getting archived.

Bug: flutter/flutter#90476

* update key (flutter#5882)

* [image_picker_android] Remove `jetifier` and `enableUnitTestBinaryResources` from gradle properties (flutter#5889)

* [webview_flutter_wkwebview] Implement one callback method for review of the design (flutter#5700)

* ignore upcoming warnings in webview_flutter_platform_interface (flutter#5855)

* ignore upcoming warnings in webview_flutter_wkwebview (flutter#5856)

* Roll Flutter from e899573 to 889a15e (176 revisions) (flutter#5905)

* [image_picker_android] Add jetifier back with gradle and androidx upgrades (flutter#5890)

* Update filter to run tasks only on PRs and main branch. (flutter#5883)

* Revert "All the workflows have been migrated to use main. (flutter#5874)" (flutter#5907)

* Roll Flutter from 889a15e to 2e1ebd8 (6 revisions) (flutter#5910)

* Roll Flutter from 2e1ebd8 to 52c47e9 (9 revisions) (flutter#5911)

* Add automatic updating of github-actions (flutter#5880)

* Revert "Add automatic updating of github-actions (flutter#5880)" (flutter#5917)

This reverts commit f781b03.

* [video_player] Android: Rotate videos recorded in landscapeRight (flutter#3820)

* Re-add tag filter (flutter#5918)

Re-adding filter removed in flutter#5883 per [discussion](https://github.com/flutter/plugins/pull/5883/files#r887442326)

* [various] Clean up obsolete references to "master" (flutter#5912)

* Roll Flutter from 52c47e9 to 1b2ee41 (8 revisions) (flutter#5916)

* Add versions to all the dependencies so they are pinned (flutter#5887)

* Pinning dependency versions

* Update gradle version.

* Revert "Update gradle version."

This reverts commit 7bf787f.

* [ci] Re-disable mirroring to master (flutter#5920)

* Ignore upcoming warnings webview_flutter_android (flutter#5922)

* ignore upcoming warnings in webview_flutter_android

* update-release-info

* [github_actions] Add automatic updating of github-actions (flutter#5919)

* Revert "Revert "Add automatic updating of github-actions (flutter#5880)" (flutter#5917)"

This reverts commit 8ded25d.

* Update dependabot.yml

Shortened prefix from "github_actions" to "gh_actions" in order to meet the 15 character max length requirement

* Roll Flutter from 1b2ee41 to be0c1bd (23 revisions) (flutter#5929)

* [url_launcher] Update README discussion of permissions (flutter#5424)

* [webview_flutter_wkwebview] Change callbacks setters to anonymous functions (flutter#5921)

* Ignore upcoming warnings (flutter#5931)

* ignore upcoming warnings

* update-release-info

* [gh_actions]: Bump lewagon/wait-on-check-action from 5e937358caba2c7876a2ee06e4a48d0664fe4967 to 1.1.1 (flutter#5926)

* [gh_actions]: Bump actions/upload-artifact from 3.0.0 to 3.1.0 (flutter#5925)

* [gh_actions]: Bump actions/labeler from 3.0.0 to 4 (flutter#5927)

* [gh_actions]: Bump actions/checkout from 2.3.4 to 3.0.2 (flutter#5923)

* [gh_actions]: Bump ossf/scorecard-action from 1.0.4 to 1.1.1 (flutter#5928)

* [webview_flutter_wkwebview] Implement Dart side of Flutter Apis (flutter#5933)

* [webview_flutter_wkwebview] Implement Objc side of Flutter Apis (flutter#5934)

* [webview]: Bump mockito-inline from 3.11.1 to 4.6.1 in /packages/webview_flutter/webview_flutter_android/android (flutter#5893)

* Roll Flutter from be0c1bd to 4ec2965 (24 revisions) (flutter#5935)

* [tools] Check integration tests for `test` (flutter#5936)

* [gh_actions]: Bump github/codeql-action from 1.1.4 to 2.1.12 (flutter#5924)

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 1.1.4 to 2.1.12.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@f5d8227...27ea8f8)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Ignore upcoming warnings (flutter#5939)

* [camera] Federate mobile implementations (flutter#5937)

* Roll Flutter from 4ec2965 to 25e0e29 (27 revisions) (flutter#5941)

* [camera] Publish federated implementations (flutter#5942)

* [file_selector]Improve API docs and examples (flutter#4824)

* Roll Flutter from 25e0e29 to bc08d85 (36 revisions) (flutter#5951)

* Roll Flutter from bc08d85 to 689b5cc (5 revisions) (flutter#5954)

* Roll Flutter from 689b5cc to 712860d (4 revisions) (flutter#5956)

* [camera] Switch to internal method channels (flutter#5943)

* [path_provider] Migrated path_provider_ios to pigeon. (flutter#5944)

* Migrated path_provider_ios to pigeon.

* increased flutter version to 3.0.0

* [google_maps_flutter] Add structure options to platform interface (flutter#5960)

* [ci] Skip expensive native tests on stable in presubmit (flutter#5962)

* Ignore deprecation for `styleFrom` button APIs (flutter#5945)

* Roll Flutter from 712860d to 0cd8f3d (6 revisions) (flutter#5967)

* [google_maps_flutter] Switch to using new structured options interface methods (flutter#5825)

* [url_launcher] Fixes call to setState after dispose. (flutter#5963)

* [google_maps_flutter] Switch web to structured options (flutter#5965)

* [webview_flutter_wkwebview] Fix bug of overriding default values of `NSURLRequest` (flutter#5969)

* [webview_flutter_wkwebview] Fixes bug where an `NSError` not an `NSErrorData` was returned (flutter#5973)

* [webview_flutter_wkwebview] Implements `currentUrl` (flutter#5974)

* [webview_flutter_wkwebview] Return an NSNumber that represents a bool (flutter#5968)

* [webview_flutter_wkwebview] Instantiate a `WKWebViewConfiguration` in `WKUIDelegate.onCreateWebView` (flutter#5971)

* Reduce dependabot freq from daily to weekly. (flutter#5972)

* [webview_flutter_wkwebview] Adds the dispose method to NSObjectFlutterApi (flutter#5970)

* [image_picker] Switch Android to internal method channel (flutter#5958)

* [webview_flutter_wkwebview] Prevents `NSObject.removeObserver` from being called without calling `addObserver` first (flutter#5975)

* [camera] Ignore body_might_complete_normally_catch_error violation (flutter#5957)

* Roll Flutter from 0cd8f3d to 873d343 (11 revisions) (flutter#5982)

* [path_provider]: Migrated path_provider for android to pigeon. (flutter#5959)

* Roll Flutter from 873d343 to 7bad4eb (13 revisions) (flutter#5984)

* [video_player] Fix disposed VideoPlayerController throwing an error when calling dispose() again (flutter#5952)

* [url_launcher] Add a new launchUrl to platform interface (flutter#5966)

This creates a new platform interface method for launching that closely
parallels the new public-facing API, so that implementations can switch
to implementing a more platform-neutral implementation. This will pave
the way for things like cleanly implementing
`externalNonBrowserApplication` support on non-iOS platforms.

A follow-up will switch the app-facing package to call this new methods
instead of the legacy method.

Implementation packages can adopt the new method as is useful for them;
eventually we can do a cleanup pass if we want to fully deprecate the
old method.

* Roll Flutter from 7bad4eb to 02558d6 (26 revisions) (flutter#5988)

* d88212c added microbenchmark for loading assets (flutter/flutter#105982)

* d3bc2bb [framework] fix RangeSlider regression due to touch slop changes (flutter/flutter#106094)

* ede7fc6 Add more CMake unit tests (flutter/flutter#106076)

* 995b332 Revert "Make RenderSliverGrid more accurately report overflow" (flutter/flutter#106123)

* 9e67070 [Conductor] Update post submit location (flutter/flutter#106120)

* f67d9b7 Revert "[Conductor] Update post submit location (#106120)" (flutter/flutter#106127)

* a783e42 Fix SliverPadding geometry  (flutter/flutter#106071)

* 3f401a1 Ignore uses of soon-to-be deprecated `NullThrownError`. (flutter/flutter#105693)

* 8e8a1c8 Fix `StretchingOverscrollIndicator` clipping and add `clipBehavior` parameter (flutter/flutter#105303)

* 96813e9 [gen_keycodes] Clarify the README that the code scheme also applies to physical keys (flutter/flutter#106078)

* ddeb0b9 [gen_keycodes] Remove invalid Web code maps (flutter/flutter#106074)

* 32b22b8 parse build version on xcodeproj (flutter/flutter#105908)

* f104be7 Ignore body_might_complete_normally_catch_error violations (flutter/flutter#105795)

* 2c15e3c [flutter_tools] update test/src to null safety (flutter/flutter#106064)

* b1b1ee9 [web] Fix JS crash when FF blocks service workers. (flutter/flutter#106072)

* fae31ee [flutter_tools] temporary directory (flutter/flutter#105815)

* f6f0d60 Update the platform properties for android bots (flutter/flutter#106146)

* 1572773 Update package:archive and pin test_api (flutter/flutter#106157)

* d08a1b0 Roll Flutter Engine from f8c0dc87bc53 to ee71e31c36ce (41 revisions) (flutter/flutter#106162)

* 58007fc Fix debugPaintSize throws 'Null Check error' (flutter/flutter#106108)

* c462cfa Roll Flutter Engine from ee71e31c36ce to 3c4ca2762e20 (2 revisions) (flutter/flutter#106167)

* cb2569f Roll Flutter Engine from 3c4ca2762e20 to df5144dd451d (1 revision) (flutter/flutter#106171)

* 526c33f Roll Flutter Engine from df5144dd451d to 746b33282f74 (1 revision) (flutter/flutter#106175)

* b29c64b Roll Flutter Engine from 746b33282f74 to 6cb83ab0f155 (1 revision) (flutter/flutter#106178)

* 12f2a35 Roll Plugins from 8bee94c to c3955d2 (3 revisions) (flutter/flutter#106200)

* 02558d6 Revert "Fix `StretchingOverscrollIndicator` clipping and add `clipBehavior` parameter" (flutter/flutter#106207)

* Added ignore deprecation comments to `styleFrom` button APIs (cont) (flutter#5983)

* [webview]: Bump gradle from 3.3.0 to 7.1.2 in /packages/webview_flutter/webview_flutter_android/example/android (flutter#5844)

* [webview_flutter] Fixes bug when onNavigationRequestCallback returns false (flutter#5981)

* [camera] Fix exception in registerWith (flutter#6009)

Fixes a regression from an unintented change in behavior during the
conversion to an in-app method channel for Android and iOS. Although the
Dart code for their implementations is almost identical to the shared
method channel version, the differences in initialization paths caused
the platform versions to try to use the widget bindings before they had
been set up: The constructor for a `dartPluginClass` is called during
`registerWith`, which is before `main`, but the constructor for the
default implementation isn't called until `CameraPlatform.instance` is
called, since Dart automatically does lazy static class initializtion.

To avoid the issue without forcing bindings to be initialized early,
this makes setting up the platform channel listener lazily.

Fixes flutter/flutter#106236

* Roll Flutter from 02558d6 to dfaec11 (29 revisions) (flutter#6011)

* [webview]: Bump annotation from 1.0.0 to 1.4.0 in /packages/webview_flutter/webview_flutter_android/android (flutter#5992)

* [webview]: Bump annotation

Bumps annotation from 1.0.0 to 1.4.0.

---
updated-dependencies:
- dependency-name: androidx.annotation:annotation
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* version bump

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com>

* Ignore upcoming warnings (flutter#6007)

* [ci] Ensure complete dependabot coverage (flutter#5976)

* [url_launcher] Switch to new launchUrl interface (flutter#5985)

* Roll Flutter from dfaec11 to 60f30e5 (23 revisions) (flutter#6015)

* [webview_flutter_wkwebview] Update copy method for Dart classes and support the `NSObject.observeValue` for subclasses (flutter#5961)

* [webview]: Bump junit from 4.12 to 4.13.2 in /packages/webview_flutter/webview_flutter_android/example/android/app (flutter#6030)

* Bump junit to 4.13.2 (flutter#5585)

* [path_provider]: Bump junit

Bumps [junit](https://github.com/junit-team/junit4) from 4.12 to 4.13.2.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.12.md)
- [Commits](junit-team/junit4@r4.12...r4.13.2)

---
updated-dependencies:
- dependency-name: junit:junit
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump junit versions

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: camsim99 <camillesimon90@gmail.com>
Co-authored-by: Stuart Morgan <stuartmorgan@google.com>

* [google_sign_in_platform_interface] Add support for `serverClientId` (flutter#5256)

This PR is a prerequisite for implementing flutter#5250.
It adds support for passing a server client ID to platform implementations when initializing them.

* Roll Flutter from 60f30e5 to a30012b (8 revisions) (flutter#6033)

* [camera] Partially Address CameraAccessException: CAMERA_ERROR (flutter#5723)

* Roll Flutter from a30012b to 6c3a0e4 (6 revisions) (flutter#6037)

* [path_provider] Fixed support for querying the root external storage directory (flutter#6036)

* Added ability to purchase multiple quantity of one product (flutter#5711)

* ignore upcoming warnings (flutter#6044)

* [google_maps_flutter] Temporary fix for initial coordinate when the surface is changed (flutter#6054)

* Roll Flutter from 6c3a0e4 to baf8686 (51 revisions) (flutter#6055)

* Roll Flutter from baf8686 to 3b11ad8 (13 revisions) (flutter#6058)

* Roll Flutter from 3b11ad8 to 6c6ae06 (28 revisions) (flutter#6060)

* [tools] Allow skipping packages by Dart version (flutter#6038)

* Roll Flutter from 6c6ae06 to 1add0d7 (16 revisions) (flutter#6064)

* [tools] Allow pre-release versions (flutter#6061)

* testing autosubmit (flutter#6062)

* Roll Flutter from 1add0d7 to efd006e (15 revisions) (flutter#6065)

* Roll Flutter from efd006e to 629f731 (6 revisions) (flutter#6068)

* Roll Flutter from 629f731 to 39a38b7 (16 revisions) (flutter#6076)

* [webview_flutter] fix: unreliable encoding for web (flutter#5737)

* Roll Flutter from 39a38b7 to 587cf5f (5 revisions) (flutter#6078)

* [image_picker_ios] fix wrong plugin name (flutter#6072)

* [google_sign_in] Implement Dart-based configuration and `serverClientId` (flutter#6034)

* [webview_flutter_wkwebview] Prevent leaking when a callback method references an object that references itself (flutter#6056)

* Roll Flutter from 587cf5f to 78e3b93 (23 revisions) (flutter#6080)

* [google_sign_in] Support Dart-based configuration and `serverClientId` (flutter#5250)

* [camera] Ignore body_might_complete_normally_catch_error violation (flutter#6049)

* [sign_in]: Bump gradle from 3.3.0 to 7.2.1 in /packages/google_sign_in/google_sign_in_android/android (flutter#5838)

* [video_player] Use epislon to compare values in matrix in test (flutter#6088)

* [in_app_purchase] Migrate android to Billing to 5.0.0 (flutter#5405)

* [espresso]: Bump okhttp from 3.12.1 to 4.10.0 in /packages/espresso/android (flutter#5955)

* [video_player]: Bump gradle from 3.5.0 to 7.2.1 in /packages/video_player/video_player_android/android (flutter#5841)

* Roll Flutter from 78e3b93 to d59923b (49 revisions) (flutter#6090)

* [quick_actions] Android handle quick action without restart (flutter#5048)

* [in_app_purchase] Update json_serializable (flutter#6092)

* [camera] Update Android Camera Access Permission Error Codes (flutter#5640)

* [google_maps_flutter_web ] Update README.md to discuss mouse issue when stacked (flutter#5875)

* Roll Flutter from d59923b to d092601 (35 revisions) (flutter#6095)

* [webview_flutter_wkwebview] Switches the platform implementation to use the native API Wrapper (flutter#6031)

* [lifecycle]: Bump gradle from 3.5.0 to 7.2.1 in /packages/flutter_plugin_android_lifecycle/android (flutter#5846)

* [file_selector] Add `allowsAny` to `XTypeGroup` (flutter#6094)

* [camera] Bump camera_web and camera_android versions to update permission exception codes (flutter#6081)

* [google_maps_flutter] Removes hotfix for test that changes the map size (flutter#6097)

* [url_launcher] Update README to use code excerpts. (flutter#6042)

* Roll Flutter from d092601 to 803ef6a (13 revisions) (flutter#6100)

* [local_auth]: Bump core from 1.3.2 to 1.8.0 in /packages/local_auth/local_auth_android/android (flutter#5885)

* Roll Flutter from 803ef6a to 5a5d021 (22 revisions) (flutter#6103)

Co-authored-by: engine-flutter-autoroll <engine-flutter-autoroll@skia.org>
Co-authored-by: David Iglesias <ditman@gmail.com>
Co-authored-by: Jesse Seales <103135467+sealesj@users.noreply.github.com>
Co-authored-by: moko256 <koutaro.mo@gmail.com>
Co-authored-by: stuartmorgan <stuartmorgan@google.com>
Co-authored-by: Ahmed Ashour <asashour@yahoo.com>
Co-authored-by: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com>
Co-authored-by: Cássio Silva Oliveira <cassioso@gmail.com>
Co-authored-by: Jami Couch <fbcouch@gmail.com>
Co-authored-by: Piotr Mitkowski <piotr.mitkowski1@gmail.com>
Co-authored-by: hellohuanlin <41930132+hellohuanlin@users.noreply.github.com>
Co-authored-by: Huey Zhang <hueyzng@gmail.com>
Co-authored-by: ChineseDragon <yimao009@qq.com>
Co-authored-by: Alexandre Zollinger Chohfi <alzollin@microsoft.com>
Co-authored-by: Hwanseok Barth Kang <tttkhs@naver.com>
Co-authored-by: godofredoc <godofredoc@google.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Maurits van Beusekom <maurits@baseflow.com>
Co-authored-by: Jenn Magder <magder@google.com>
Co-authored-by: Martin Georgiu <martin.georgiu@gmail.com>
Co-authored-by: Emmanuel Garcia <egarciad@google.com>
Co-authored-by: Jonah Williams <jonahwilliams@google.com>
Co-authored-by: Matej Knopp <matej.knopp@gmail.com>
Co-authored-by: Tim Sneath <timsneath@google.com>
Co-authored-by: Kyle Finlinson <kyle.finlinson@verygood.ventures>
Co-authored-by: Chris Yang <ychris@google.com>
Co-authored-by: keyonghan <54558023+keyonghan@users.noreply.github.com>
Co-authored-by: Alexandre Ardhuin <alexandre.ardhuin@gmail.com>
Co-authored-by: Drew Roen <102626803+drewroengoogle@users.noreply.github.com>
Co-authored-by: Ricardo Amador <32242716+ricardoamador@users.noreply.github.com>
Co-authored-by: 8rine23 <58650422+TowaYamashita@users.noreply.github.com>
Co-authored-by: gaaclarke <30870216+gaaclarke@users.noreply.github.com>
Co-authored-by: Darren Austin <darren@darrenaustin.org>
Co-authored-by: Sam Rawlins <sam.rawlins@gmail.com>
Co-authored-by: Navaron Bracke <brackenavaron@gmail.com>
Co-authored-by: Darren Austin <darrenaustin@google.com>
Co-authored-by: camsim99 <camillesimon90@gmail.com>
Co-authored-by: Gabriel Terwesten <gabriel@terwesten.net>
Co-authored-by: Camille Simon <43054281+camsim99@users.noreply.github.com>
Co-authored-by: Vladislav Khomenko <vladislav.homenko@gmail.com>
Co-authored-by: Flafy <flafyarazi@gmail.com>
Co-authored-by: Alex Sandri <me@alexsandri.com>
Co-authored-by: Sam Rawlins <srawlins@google.com>
Co-authored-by: Gary Qian <garyq@google.com>
Co-authored-by: TabooSun <taboosun1996@gmail.com>
Co-authored-by: idkq <76702881+idkq@users.noreply.github.com>
Co-authored-by: Devesh Pal <newdev0@outlook.com>
yutaaraki-toydium pushed a commit to yutaaraki-toydium/plugins that referenced this issue Aug 12, 2022
Fixes a regression from an unintented change in behavior during the
conversion to an in-app method channel for Android and iOS. Although the
Dart code for their implementations is almost identical to the shared
method channel version, the differences in initialization paths caused
the platform versions to try to use the widget bindings before they had
been set up: The constructor for a `dartPluginClass` is called during
`registerWith`, which is before `main`, but the constructor for the
default implementation isn't called until `CameraPlatform.instance` is
called, since Dart automatically does lazy static class initializtion.

To avoid the issue without forcing bindings to be initialized early,
this makes setting up the platform channel listener lazily.

Fixes flutter/flutter#106236
mauricioluz pushed a commit to mauricioluz/plugins that referenced this issue Jan 26, 2023
Fixes a regression from an unintented change in behavior during the
conversion to an in-app method channel for Android and iOS. Although the
Dart code for their implementations is almost identical to the shared
method channel version, the differences in initialization paths caused
the platform versions to try to use the widget bindings before they had
been set up: The constructor for a `dartPluginClass` is called during
`registerWith`, which is before `main`, but the constructor for the
default implementation isn't called until `CameraPlatform.instance` is
called, since Dart automatically does lazy static class initializtion.

To avoid the issue without forcing bindings to be initialized early,
this makes setting up the platform channel listener lazily.

Fixes flutter/flutter#106236
ValentinVignal pushed a commit to ValentinVignal/flutter__packages that referenced this issue Feb 23, 2023
Fixes a regression from an unintented change in behavior during the
conversion to an in-app method channel for Android and iOS. Although the
Dart code for their implementations is almost identical to the shared
method channel version, the differences in initialization paths caused
the platform versions to try to use the widget bindings before they had
been set up: The constructor for a `dartPluginClass` is called during
`registerWith`, which is before `main`, but the constructor for the
default implementation isn't called until `CameraPlatform.instance` is
called, since Dart automatically does lazy static class initializtion.

To avoid the issue without forcing bindings to be initialized early,
this makes setting up the platform channel listener lazily.

Fixes flutter/flutter#106236
@flutter-triage-bot flutter-triage-bot bot added the package flutter/packages repository. See also p: labels. label Jul 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: regression It was better in the past than it is now p: camera The camera plugin P1 High-priority issues at the top of the work list package flutter/packages repository. See also p: labels.
Projects
None yet
Development

Successfully merging a pull request may close this issue.