WifiWizard2 icon indicating copy to clipboard operation
WifiWizard2 copied to clipboard

Android 10, not able to connect to wifi network

Open digaus opened this issue 5 years ago • 28 comments

Prerequisites

Check all boxes if you have done the following:

  • [x] Checked that your issue isn't already filed: https://github.com/tripflex/wifiwizard2/issues
  • [x] Make sure you fill out the Issue Type below

Issue type

Select all that apply

  • [x] Bug
  • [ ] Enhancement
  • [ ] Task
  • [ ] Question
  • [ ] Other

Description

On Android 10 I am not able to connect to networks anymore... Anyone else has this issue?

Steps to Reproduce

Try connect to wifi network on Android 10 results in a timeout

Expected behavior: [What you expect to happen]

Should connect to network

Actual behavior: [What actually happens]

Does not connect

Reproduces how often: [What percentage of the time does it reproduce?]

100%

Versions

Android 10

Additional Information

digaus avatar Dec 24 '19 01:12 digaus

I’m going to assume you have network services enabled?

On Tue, 24 Dec 2019 at 12:15 pm, digaus [email protected] wrote:

Prerequisites

Check all boxes if you have done the following:

  • Checked that your issue isn't already filed: https://github.com/tripflex/wifiwizard2/issues
  • Make sure you fill out the Issue Type below

Issue type

Select all that apply

  • Bug
  • Enhancement
  • Task
  • Question
  • Other

Description

On Android 10 I am not able to connect to networks anymore... Anyone else has this issue? Steps to Reproduce

Try connect to wifi network on Android 10 results in a timeout

Expected behavior: [What you expect to happen]

Should connect to network

Actual behavior: [What actually happens]

Does not connect

Reproduces how often: [What percentage of the time does it reproduce?]

100% Versions

Android 10 Additional Information

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/tripflex/WifiWizard2/issues/99?email_source=notifications&email_token=ADO6DHHALTI2C2D4KKJX72TQ2FPB7A5CNFSM4J6ZPG32YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4ICNQI7Q, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADO6DHF423RKXJX6K3QF6Z3Q2FPB7ANCNFSM4J6ZPG3Q .

-- Regards, Nicholas Clancy Technical Director & Partner Inline images 0420 634 180 or +61 420 634 180 [email protected] Norwest Business Park, Bella Vista, NSW, 2153, Australia www.viscreate.com.a

arsenal942 avatar Dec 24 '19 01:12 arsenal942

@arsenal942

Yes I have. What's odd is that I do not get any errors in Logcat. EnableNetwork even returns true but it just won't connect to it.

digaus avatar Dec 24 '19 07:12 digaus

I had this same issue. Note 9, had Android 9 2 days ago, once i updated to Android 10, it could no longer connect.

SondreNjaastad avatar Jan 24 '20 06:01 SondreNjaastad

Confirmed issue on OnePlus 7T, Android Version 10, Build Number 10.0.5.HD63CB

spacehunter avatar Feb 07 '20 15:02 spacehunter

Maybe related to these Android 10 privacy related changes? https://developer.android.com/about/versions/10/privacy/changes#enable-disable-wifi

pa-de-solminihac avatar Feb 19 '20 16:02 pa-de-solminihac

Maybe related to these Android 10 privacy related changes? https://developer.android.com/about/versions/10/privacy/changes#enable-disable-wifi

Nope. Android 10 changed the WiFi handling. You cannot auto connect anymore, always need user confirmation.

Implemented a solution in my capacitor plugin: https://github.com/digaus/capacitor-wifi/blob/master/android/src/main/java/com/digaus/capwifi/WifiService.java#L79

digaus avatar Feb 19 '20 21:02 digaus

@digaus @arsenal942

is there an fix for this issue? My samsung always had android 9 but now 10 and he has problems connecting.

HusFNS avatar May 05 '20 07:05 HusFNS

I'm having the same issue. Samsung Galaxy S9 running Android 10.

heythisisnate avatar Jun 01 '20 17:06 heythisisnate

I upgraded my OnePlus 5T to from Android 9 to Android 10 last week. Reading this issue, I expected it to fail to connect but it is still working. So maybe it's not (only) Android 10 related?

I had issues in the past with another phone, Samsung J3: after an US update it could no longer connect, then another update fixed it.

pa-de-solminihac avatar Jun 23 '20 07:06 pa-de-solminihac

I noticed that when trying to connect to a Wifi network I need both :

  • location permission to have been accepted
  • location to be enabled

I am pretty sure that on previous Android versions the connection did succeed when location is disabled, but it is no longer the case.

pa-de-solminihac avatar Jun 23 '20 18:06 pa-de-solminihac

I just encountered that the connection functionality depends on the target SDK version set for the app. As soon as I increased the compile and target SKD version from 28 to 29 (as formally required by the play store since August 2020) (dis)connect did no longer work. Reverted to SDK 28 and it was fine again, even on devices with Android 10.

astinka avatar Aug 05 '20 13:08 astinka

Looks like this may fix the issue -> https://github.com/tripflex/WifiWizard2/pull/108 can we get that merged?

bendoerr avatar Aug 11 '20 18:08 bendoerr

Also this PR -> https://github.com/tripflex/WifiWizard2/pull/104/files. Is this project still maintained.

bendoerr avatar Aug 11 '20 18:08 bendoerr

@bendoerr none of these two seems to work for me, does it work for you?

gregor-srdic avatar Sep 02 '20 07:09 gregor-srdic

@bendoerr none of these two seems to work for me, does it work for you?

Tried these pull requests as they seemed to be getting good comments, however neither worked for me:

I then removed and then re-added the addon before testing on a moto g phone (android 10):

$ cordova plugin remove wifiwizard2
$ cordova plugin add ../WifiWizard2/

I don't get any feedback in the js callbacks within cordova, but I do see this in the $ adb logcat output:

WifiService: getConfiguredNetworks not allowed for uid=10396

not sure if this is the cause of my issue??

I'm trying to connect to a hotspot created by an esp8266 device (using WifiWizard2.connect()) and then jump back to the original SSID once the settings are sent to the esp device.

Was working fine until my android 10 update :(

I can't find any other cordova plugin that comes close the the features of WifiWizard2.

both pull request #108 & #104 did fix the original issue on the master branch of ERROR_ADDING_NETWORK returned by the cordova js callbacks. So it seems that the android 10 (API 29) code kicks in with the WifiNetworkSpecifier.Builder() :+1:

emrysr avatar Sep 07 '20 12:09 emrysr

If you'd like to filter the output from logcat so that you only see relevant info - this seems to work well for me...

adb logcat -v tag | grep -i -e 'connectivityservice\|wifiwizard2\|getconfigurednetworks'

let me know if there's a better regexp pattern I should use to debug :)

emrysr avatar Sep 07 '20 12:09 emrysr

We haven't had time to investigate. However we will be testing this out and working out a solution in the next few weeks. I doubt we will get any feedback from @tripflex as it seems he has stopped maintaining and/or no longer on github. https://github.com/tripflex/WifiWizard2/issues/111

bendoerr avatar Sep 08 '20 12:09 bendoerr

Yea trip flex is inactive now and I’m unable to update NPM.

I can add some other owners to the repo since I’m also just as bad for inactivity (work life too busy)

On Tue, 8 Sep 2020 at 10:33 pm, Ben Doerr [email protected] wrote:

We haven't had time to investigate. However we will be testing this out and working out a solution in the next few weeks. I doubt we will get any feedback from @tripflex https://github.com/tripflex as it seems he has stopped maintaining and/or no longer on github. #111 https://github.com/tripflex/WifiWizard2/issues/111

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/tripflex/WifiWizard2/issues/99#issuecomment-688835874, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADO6DHBQOTLIMDCVLZFDCZTSEYQAPANCNFSM4J6ZPG3Q .

-- Regards, Nicholas Clancy Technical Director & Partner Inline images 0420 634 180 or +61 420 634 180 [email protected] Norwest Business Park, Bella Vista, NSW, 2153, Australia www.viscreate.com.a

arsenal942 avatar Sep 08 '20 12:09 arsenal942

@arsenal942 Thanks for the confirmation.

bendoerr avatar Sep 08 '20 12:09 bendoerr

Looks like this issue might be fixed by PR: 122 !

DarkAng3L avatar Mar 22 '21 11:03 DarkAng3L

Looks like this issue might be fixed by PR: 122 !

Still doesn't work. Tested with the SDK 28, meanwhile targetVersion was set as 29.

kevinprotoss avatar Mar 30 '21 15:03 kevinprotoss

It still doesn't work. Getting "ERROR_ADDING_NETWORK" error. Tested with Android 11 and Location permission has been enabled.

naresh33 avatar Apr 12 '21 13:04 naresh33

I also get ERROR_ADDING_NETWORK error. Tested on Galaxy m12 (Android 11)

AndroidManifest.xml

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:maxSdkVersion="30" android:name="android.permission.BLUETOOTH" />
    <uses-permission android:maxSdkVersion="30" android:name="android.permission.BLUETOOTH_ADMIN" />
    <uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
    <uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE" />
    <uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />

sultanmyrza avatar Aug 16 '21 11:08 sultanmyrza

Nothing new? Does anybody know what to do?

bauyrzhanospan avatar Oct 11 '21 13:10 bauyrzhanospan

I use this fork and it works fine on Android>=10 (also Android<10) and iOS: https://github.com/VijayVaveHealth/WifiWizard2

Maho38 avatar Oct 11 '21 13:10 Maho38

Bonjour, j'utilise WifiWizard2, mais impossible d'ajouter le réseau wifi sur Android 11. J'ai toujours cette erreur : ERROR_ADDING_NETWORK Cela fonctionne sur Android 10 sans le moindre problème et iOS aussi.

Voici mes permissions Android : <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" /> <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

<preference name="android-minSdkVersion" value="23" /> <preference name="android-targetSdkVersion" value="30" /> <preference name="android-compileSdkVersion" value="30" /> merci de votre aide

liloune89 avatar Oct 27 '21 14:10 liloune89

Juste pour informer, si je mets targetSdkVersion à 28 <preference name="android-targetSdkVersion" value="28" /> Je n'ai plus cette erreur ! Mais je pense que Google Play ne va pas aimer.

liloune89 avatar Nov 02 '21 12:11 liloune89

@arsenal942 On android 10 we have same issue with this plugin. A fork of this plugin doing job in better way.

Reference: Link Plugin Repo: Link

Please check if we can provide those features officially here

kumarmanishc avatar Sep 15 '22 11:09 kumarmanishc