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

scanNetworks() throwing PlatformException on Android 11 Samsung A52 #15

Open
aschaepper opened this issue Sep 3, 2021 · 0 comments
Open

Comments

@aschaepper
Copy link

Hello together

This could be related to this: #10 but I'm not sure and im getting a different type of exception, a "PlatformException".

I dig a bit deeper and found that it the error most probably comes from WifiManager.StartScan()
https://developer.android.com/reference/android/net/wifi/WifiManager#startScan()
Location in Code:
https://github.com/weplenish/flutter-plugins/blob/master/wifi_flutter/android/src/main/kotlin/com/weplenish/wifi_flutter/WifiFlutterPlugin.kt#L59

First I thought its because of the deprecation of this method and its not possible at all but I also use this Flutter library:
https://github.com/weplenish/flutter_wifi_connect
https://pub.dev/packages/flutter_wifi_connect

And the code here which also uses StartScan from WifiManager works (From the flutter library: FlutterWifiConnect.connectByPrefix)
https://github.com/weplenish/flutter_wifi_connect/blob/main/android/src/main/kotlin/com/weplenish/flutter_wifi_connect/FlutterWifiConnectPlugin.kt#L217

To me it looks very similar (just read through it in github, I couldn't debug it directly). So I'm not sure where the error is (I cant imagine its from the suppressed lints and deprecation messages?). Maybe for you this is a bit easier to spot?

I'm using Android 11 on a Samsung A52 here it doesnt work.
On a Huawai P9 with Android 7 it works.

Maybe this helps you to find this or even the other errors?

Unfortunately I can't fix it myself at the moment, I'm freelancing and encountered this problem in a project for the customer, we have kind of a tight budget and schedule so I will weasel around the problem instead of fixing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant