plus_plugins icon indicating copy to clipboard operation
plus_plugins copied to clipboard

[Bug]: wifiGateway IP is null

Open voulgarakis opened this issue 2 months ago • 2 comments

Platform

Android 12 and Android 16

Plugin

network_info_plus

Version

6.1.4

Flutter SDK

3.32.7

Steps to reproduce

Just added the package and tried to get the default gateway IP for an IoT device i have

Code Sample

final info = NetworkInfo();
final wifiGateway = await info.getWifiGatewayIP();
print("NetworkInfo wifiGateway: $wifiGateway");

Logs

I/flutter (25369): NetworkInfo wifiGateway: null

Flutter Doctor

[!] Flutter (Channel [user-branch], 3.32.7, on macOS 15.6.1 24G90 darwin-arm64, locale en-GB) [3.0s]
    ! Flutter version 3.32.7 on channel [user-branch] at /Users/voulgarakis/development/flutter
      Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
      If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/setup.
    ! Upstream repository unknown source is not a standard remote.
      Set environment variable "FLUTTER_GIT_URL" to unknown source to dismiss this error.
    • Framework revision d7b523b356 (3 months ago), 2025-07-15 17:03:46 -0700
    • Engine revision 39d6d6e699
    • Dart version 3.8.1
    • DevTools version 2.45.1
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks
      and upgrades.

[!] Android toolchain - develop for Android devices (Android SDK version 35.0.0) [2.6s]
    • Android SDK at /Users/voulgarakis/Library/Android/sdk
    • Platform android-36, build-tools 35.0.0
    ✗ Android SDK file not found: /Users/voulgarakis/Library/Android/sdk/platforms/android-36/android.jar.
    • Try re-installing or updating your Android SDK,
      visit https://flutter.dev/to/macos-android-setup for detailed instructions.

[✓] Xcode - develop for iOS and macOS (Xcode 26.0.1) [3.3s]
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 17A400
    • CocoaPods version 1.16.2

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

[✓] Android Studio (version 2024.1) [13ms]
    • 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 17.0.11+0-17.0.11b1207.24-11852314)

[✓] VS Code (version 1.103.2) [12ms]
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.120.0

[✓] Connected device (2 available) [7.6s]
    • macOS (desktop) • macos  • darwin-arm64   • macOS 15.6.1 24G90 darwin-arm64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 141.0.7390.66
    ! Error: Browsing on the local area network for Giannis_iphone. Ensure the device is unlocked and attached with a cable or associated with
      the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)
    ! Error: Browsing on the local area network for Efstratios’s iPhone. Ensure the device is unlocked and attached with a cable or associated
      with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)

[✓] Network resources [307ms]
    • All expected network resources are available.

! Doctor found issues in 2 categories.

Checklist before submitting a bug

  • [x] I searched issues in this repository and couldn't find such bug/problem
  • [x] I Google'd a solution and I couldn't find it
  • [x] I searched on StackOverflow for a solution and I couldn't find it
  • [x] I read the README.md file of the plugin
  • [x] I'm using the latest version of the plugin
  • [x] All dependencies are up to date with flutter pub upgrade
  • [x] I did a flutter clean
  • [x] I tried running the example project

voulgarakis avatar Oct 14 '25 13:10 voulgarakis

when connected to the home wifi network the log is fine:

I/flutter (15108): NetworkInfo wifiGateway: 192.168.68.1

voulgarakis avatar Oct 15 '25 09:10 voulgarakis

+1 Im having the same issue

posymeon avatar Oct 30 '25 13:10 posymeon