wifi icon indicating copy to clipboard operation
wifi copied to clipboard

Wifi.ip issue

Open ashishpatel1992 opened this issue 5 years ago • 2 comments

When I am on mobile network and not connected to WiFi This line fails final String ip = await Wifi.ip; The following error I get:

E/MethodChannel#plugins.ly.com/wifi(25613): Failed to handle method call
E/MethodChannel#plugins.ly.com/wifi(25613): java.lang.NullPointerException: Attempt to invoke interface method 'void io.flutter.plugin.common.MethodChannel$Result.success(java.lang.Object)' on a null object reference
E/MethodChannel#plugins.ly.com/wifi(25613): 	at com.ly.wifi.WifiDelegate.launchIP(WifiDelegate.java:141)
E/MethodChannel#plugins.ly.com/wifi(25613): 	at com.ly.wifi.WifiDelegate.getIP(WifiDelegate.java:128)
E/MethodChannel#plugins.ly.com/wifi(25613): 	at com.ly.wifi.WifiPlugin.onMethodCall(WifiPlugin.java:55)
E/MethodChannel#plugins.ly.com/wifi(25613): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:222)
E/MethodChannel#plugins.ly.com/wifi(25613): 	at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:96)
E/MethodChannel#plugins.ly.com/wifi(25613): 	at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:643)
E/MethodChannel#plugins.ly.com/wifi(25613): 	at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#plugins.ly.com/wifi(25613): 	at android.os.MessageQueue.next(MessageQueue.java:336)
E/MethodChannel#plugins.ly.com/wifi(25613): 	at android.os.Looper.loop(Looper.java:174)
E/MethodChannel#plugins.ly.com/wifi(25613): 	at android.app.ActivityThread.main(ActivityThread.java:7682)
E/MethodChannel#plugins.ly.com/wifi(25613): 	at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#plugins.ly.com/wifi(25613): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516)
E/MethodChannel#plugins.ly.com/wifi(25613): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
E/DartMessenger(25613): Uncaught exception in binary message listener
E/DartMessenger(25613): java.lang.IllegalStateException: Reply already submitted
E/DartMessenger(25613): 	at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:135)
E/DartMessenger(25613): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:240)
E/DartMessenger(25613): 	at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:96)
E/DartMessenger(25613): 	at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:643)
E/DartMessenger(25613): 	at android.os.MessageQueue.nativePollOnce(Native Method)
E/DartMessenger(25613): 	at android.os.MessageQueue.next(MessageQueue.java:336)
E/DartMessenger(25613): 	at android.os.Looper.loop(Looper.java:174)
E/DartMessenger(25613): 	at android.app.ActivityThread.main(ActivityThread.java:7682)
E/DartMessenger(25613): 	at java.lang.reflect.Method.invoke(Native Method)
E/DartMessenger(25613): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516)
E/DartMessenger(25613): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
Reloaded 1 of 566 libraries in 432ms.
I/flutter (25613): Finish. Found 0 device(s)

Flutter Doctor result

[√] Flutter (Channel stable, v1.7.8+hotfix.3, on Microsoft Windows [Version 10.0.18363.592], locale en-IN)
    • Flutter version 1.7.8+hotfix.3 at C:\flutter
    • Framework revision b712a172f9 (7 months ago), 2019-07-09 13:14:38 -0700
    • Engine revision 54ad777fd2
    • Dart version 2.4.0

[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at C:\Users\Ashish\AppData\Local\Android\Sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • ANDROID_HOME = C:\Users\Ashish\AppData\Local\Android\Sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
    • All Android licenses accepted.

[√] Android Studio (version 3.5)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 42.1.1
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)

[√] VS Code, 64-bit edition (version 1.41.1)
    • VS Code at C:\Program Files\Microsoft VS Code
    • Flutter extension version 3.7.1

[√] Connected device (1 available)
    • GM1911 • bdf409c6 • android-arm64 • Android 10 (API 29)

ashishpatel1992 avatar Jan 25 '20 17:01 ashishpatel1992

same here

rubenCodeforges avatar Sep 01 '20 07:09 rubenCodeforges

Huh, glad I'm not the only one. Same issue here Edit: Maybe it's something in Android 10

johnnycook avatar Mar 02 '21 14:03 johnnycook