tripflex / WifiWizard2

A Cordova plugin for managing Wifi networks (new version of WiFiWizard) - Latest is version 3+
https://www.npmjs.com/package/cordova-plugin-wifiwizard2
Apache License 2.0
123 stars 146 forks source link

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

Open digaus opened 4 years ago

digaus commented 4 years ago

<!--

Have you read the plugins' Code of Conduct? By creating an Issue, you are expected to comply with it, including treating everyone with respect: https://github.com/tripflex/wifiwizard2/blob/master/CODE_OF_CONDUCT.md

-->

Prerequisites

Check all boxes if you have done the following:

Issue type

Select all that apply

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 commented 4 years ago

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

On Tue, 24 Dec 2019 at 12:15 pm, digaus notifications@github.com wrote:

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

— 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 nick@viscreate.com.au Norwest Business Park, Bella Vista, NSW, 2153, Australia www.viscreate.com.a

digaus commented 4 years ago

@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 commented 4 years ago

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 commented 4 years ago

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

pa-de-solminihac commented 4 years ago

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

digaus commented 4 years ago

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 commented 4 years ago

@digaus @arsenal942

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

heythisisnate commented 4 years ago

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

pa-de-solminihac commented 4 years ago

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 commented 4 years ago

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

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 commented 4 years ago

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 commented 4 years ago

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

bendoerr commented 4 years ago

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

gregor-srdic commented 4 years ago

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

emrysr commented 4 years ago

@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 commented 4 years ago

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 commented 4 years ago

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

arsenal942 commented 4 years ago

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 notifications@github.com 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 nick@viscreate.com.au Norwest Business Park, Bella Vista, NSW, 2153, Australia www.viscreate.com.a

bendoerr commented 4 years ago

@arsenal942 Thanks for the confirmation.

DarkAng3L commented 3 years ago

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

kevinprotoss commented 3 years ago

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 commented 3 years ago

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

sultanmyrza commented 3 years ago

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 commented 3 years ago

Nothing new? Does anybody know what to do?

Maho38 commented 3 years ago

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

liloune89 commented 3 years ago

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 commented 2 years ago

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 commented 2 years ago

@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