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

Android 10, not able to connect to wifi network #99

Open
3 of 7 tasks
digaus opened this issue Dec 24, 2019 · 28 comments
Open
3 of 7 tasks

Android 10, not able to connect to wifi network #99

digaus opened this issue Dec 24, 2019 · 28 comments

Comments

@digaus
Copy link

digaus commented Dec 24, 2019

Prerequisites

Check all boxes if you have done the following:

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

@arsenal942
Copy link
Collaborator

arsenal942 commented Dec 24, 2019 via email

@digaus
Copy link
Author

digaus commented Dec 24, 2019

@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.

@SondreNjaastad
Copy link

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

@spacehunter
Copy link

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

@pa-de-solminihac
Copy link

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

@digaus
Copy link
Author

digaus commented Feb 19, 2020

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

@HusFNS
Copy link

HusFNS commented May 5, 2020

@digaus @arsenal942

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

@heythisisnate
Copy link

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

@pa-de-solminihac
Copy link

pa-de-solminihac commented Jun 23, 2020

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
Copy link

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.

@astinka
Copy link

astinka commented Aug 5, 2020

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.

@bendoerr
Copy link

Looks like this may fix the issue -> #108 can we get that merged?

@bendoerr
Copy link

bendoerr commented Aug 11, 2020

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

@gregor-srdic
Copy link

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

@emrysr
Copy link

emrysr commented Sep 7, 2020

@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() 👍

@emrysr
Copy link

emrysr commented Sep 7, 2020

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 :)

@bendoerr
Copy link

bendoerr commented Sep 8, 2020

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. #111

@arsenal942
Copy link
Collaborator

arsenal942 commented Sep 8, 2020 via email

@bendoerr
Copy link

bendoerr commented Sep 8, 2020

@arsenal942 Thanks for the confirmation.

@DarkAng3L
Copy link

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

@kevinprotoss
Copy link

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.

@naresh33
Copy link

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

@sultanmyrza
Copy link

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" />

@bauyrzhanospan
Copy link

Nothing new? Does anybody know what to do?

@Maho38
Copy link

Maho38 commented Oct 11, 2021

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

@liloune89
Copy link

liloune89 commented Oct 27, 2021

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
Copy link

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.

@kumarmanishc
Copy link

@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

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