eopeter / flutter_dtmf

DTMF Tone Generator for Flutter Applications.
MIT License
11 stars 20 forks source link

"Error: Binding has not yet been initialized " when running on device "chrome" #6

Closed rwbr closed 11 months ago

rwbr commented 2 years ago

When you try to run the example in a web browser flutter run -d chrome, the following exception is getting thrown:

❯ flutter run -d chrome                                                                                      [16:18:18]
Launching lib/main.dart on Chrome in debug mode...
Waiting for connection from debug service on Chrome...             16,1s
This app is linked to the debug service: ws://127.0.0.1:56296/iBwJvijl5Fg=/ws
Debug service listening on ws://127.0.0.1:56296/iBwJvijl5Fg=/ws

💪 Running with sound null safety 💪

🔥  To hot restart changes while running, press "r" or "R".
For a more detailed help message, press "h". To quit, press "q".

An Observatory debugger and profiler on Chrome is available at: http://127.0.0.1:56296/iBwJvijl5Fg=
Flutter Web Bootstrap: Programmatic
Error: Binding has not yet been initialized.
The "instance" getter on the ServicesBinding binding mixin is only available once that binding has been initialized.
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.
In a test, one can call "TestWidgetsFlutterBinding.ensureInitialized()" as the first line in the test's "main()" method
to initialize the binding.
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.
    at Object.throw_ [as throw] (http://localhost:56218/dart_sdk.js:5080:11)
    at http://localhost:56218/packages/flutter/src/foundation/binding.dart.lib.js:81:21
    at BindingBase.checkInstance (http://localhost:56218/packages/flutter/src/foundation/binding.dart.lib.js:103:26)
    at get instance [as instance] (http://localhost:56218/packages/flutter/src/services/restoration.dart.lib.js:5825:35)
    at platform_channel.MethodChannel.new.setMethodCallHandler
    (http://localhost:56218/packages/flutter/src/services/restoration.dart.lib.js:1592:74)
    at DtmfPlugin.registerWith (http://localhost:56218/packages/flutter_dtmf/dtmf_web.dart.lib.js:48:15)
    at Object.registerPlugins
    (http://localhost:56218/packages/flutter_dtmf_example/generated_plugin_registrant.dart.lib.js:13:25)
    at http://localhost:56218/web_entrypoint.dart.lib.js:39:39
    at Object._checkAndCall (http://localhost:56218/dart_sdk.js:5279:16)
    at Object.dcall (http://localhost:56218/dart_sdk.js:5284:17)
    at http://localhost:56218/dart_sdk.js:140287:18
    at Generator.next (<anonymous>)
    at runBody (http://localhost:56218/dart_sdk.js:40660:34)
    at Object._async [as async] (http://localhost:56218/dart_sdk.js:40691:7)
    at _engine.AppBootstrap.new.<anonymous> (http://localhost:56218/dart_sdk.js:140285:67)
    at Object._checkAndCall (http://localhost:56218/dart_sdk.js:5279:16)
    at Object.callMethod (http://localhost:56218/dart_sdk.js:5322:17)
    at Object.dsend (http://localhost:56218/dart_sdk.js:5325:17)
    at _engine.AppBootstrap.new.<anonymous> (http://localhost:56218/dart_sdk.js:140636:22)
    at Generator.next (<anonymous>)
    at runBody (http://localhost:56218/dart_sdk.js:40660:34)
    at Object._async [as async] (http://localhost:56218/dart_sdk.js:40691:7)
    at http://localhost:56218/dart_sdk.js:140635:215
    at Object._checkAndCall (http://localhost:56218/dart_sdk.js:5279:16)
    at Object.dcall (http://localhost:56218/dart_sdk.js:5284:17)
    at ret (http://localhost:56218/dart_sdk.js:62210:21)
    at new Promise (<anonymous>)
    at http://localhost:56218/dart_sdk.js:140635:119
    at Object._checkAndCall (http://localhost:56218/dart_sdk.js:5279:16)
    at Object.dcall (http://localhost:56218/dart_sdk.js:5284:17)
    at Object.ret [as runApp] (http://localhost:56218/dart_sdk.js:62210:21)
    at http://localhost:56218/:53:26
the Dart compiler exited unexpectedly.

My environment is set up like this:

❯ flutter doctor -v                                                                                          [16:19:31]
[✓] Flutter (Channel stable, 3.0.2, on macOS 12.4 21F79 darwin-x64, locale de-DE)
    • Flutter version 3.0.2 at /Users/ralfweinbrecher/Development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision cd41fdd495 (3 weeks ago), 2022-06-08 09:52:13 -0700
    • Engine revision f15f824b57
    • Dart version 2.17.3
    • DevTools version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/ralfweinbrecher/Library/Android/sdk/
    • Platform android-31, build-tools 31.0.0
    • ANDROID_HOME = /Users/ralfweinbrecher/Library/Android/sdk/
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • 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.11+0-b60-7590822)

[✓] VS Code (version 1.68.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.42.0

[✓] Connected device (3 available)
    • iPhone 13 Pro (mobile) • B233C434-89BA-4CFC-AF42-DFAFF451FA14 • ios            •
      com.apple.CoreSimulator.SimRuntime.iOS-15-5 (simulator)
    • macOS (desktop)        • macos                                • darwin-x64     • macOS 12.4 21F79 darwin-x64
    • Chrome (web)           • chrome                               • web-javascript • Google Chrome 102.0.5005.115
    ! Error: iPhone  is not connected. Xcode will continue when iPhone von Ralf is connected. (code -13)

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

• No issues found!
rwbr commented 2 years ago

It leads the application to crash when executing

DtmfPlugin.registerWith(registrar);

in file generated_plugin_registrant.

rwbr commented 2 years ago

Any news or conclusions?

rwbr commented 2 years ago

Hello? 👋 Some conclusions?

eopeter commented 2 years ago

I’ll provide an update later today. Sorry for the delays.

On Aug 30, 2022, at 2:13 AM, Ralf Weinbrecher @.***> wrote:

 Hello? 👋 Some conclusions?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.

eswarupkumar commented 2 years ago

Hey @eopeter, waiting for an update on this.

I’ll provide an update later today. Sorry for the delays. On Aug 30, 2022, at 2:13 AM, Ralf Weinbrecher @.***> wrote:  Hello? 👋 Some conclusions? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.

Yahllil commented 1 year ago

Any update?

farhanvkdev commented 1 year ago

Hello, it's been almost a year, any update ?

eopeter commented 11 months ago

try on 3.0.0 version of plugin