-
Notifications
You must be signed in to change notification settings - Fork 146
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
3.0.0 fail to add network if you try a second time #10
Comments
@bigt11 Ahhh!! Thanks for reporting this! So i'm going to do some testing myself, but it sounds to me like it may be an issue with the UID of the app changing on reboot, and with the new permissions on wifi in newer versions of Android, if the UID of the app does not match the UID that created the configuration, you won't be able to add or update it in any way. Are you running this on an actual Android device, or are you running it on an emulator? Can you please try using the demo project I created for testing and see if that gives you the same issue? I just pushed an update last night that completely refactored how the The demo project has buttons for all the available methods, so that may help debug this further. In the meantime i'm going to do some of my own testing and will report back |
I'll try your demo app and your latest code. I am using a dev version of chrome os on a chromebook that can do android apps. |
@bigt11 that may be the problem but i'm honestly not sure, I know there are issues with trying to use this on emulated versions of android, and that may be the problem. I just tested this on my personal Android 7.1.1 dev device and was unable to reproduce the issue using the WifiWizard2Demo project I think the issue is actually with your code base you're using, if you look at where you're turning on wifi, you're not awaiting the promise to resolve before calling So this: should be this Version 3.0.0 also introduces new methods, so instead of using You also don't need to turn on the wifi manually (you can if you want, but not required), the plugin will automagically turn on WiFi if you call a method that requires WiFi to be enabled |
@bigt11 go ahead and reopen this if it's still an issue (just trying to keep issues clean so I can keep track of them) |
I am re-opening this. I am using your 3.0.0 code commit 63c7748 with a 7.1 device. I have also tried your test app and the outcome is the same. If I have a freshly restarted device, I can run Here is the full output
No that is connected, If I run the same connect command again So it will connect after a fresh restart, but if you connect after it is already connected, it wont connect again. It seems like it disconnects but never successfully connects again. Running the connect command a second time output is below.
So regardless, it seems like it gets the IDLE signal for me at all times even if it was successful. The wild card it, that I tried this same code on a new 7.1 phone I bought (a different device completely, not the device giving me these errors) and the connect command seemed to work always regardless of if it was already connected to the same ssid. I did not get any logcat from that device, because it seemed to work. I don't know what the connect command does differently running on an ssid that it is already connected to, but maybe a clue is somewhere in here
It seems to try and remove network id 0, then id 1. I know in your code, you increase the network ID number so maybe it is something with that. |
Return respones on android
I am trying your 3.0.0 d1b8cde commit. Using android 7.1.1
I have included my code that I am testing with. The issue I am running into is if I run the code after a fresh reboot of the system, I can successfully do a WifiWizard2.add (I have not tried doConnect yet).
then...
if I just try and run the same code again, it fails (I put my function on a button to run my code).
I also added my own log.d with the tag TAO to help me track down stuff that is happening.
I have not made a guess of why that is yet, just pointing it out. But it feels like something with the network ID's when it is trying to update it. something around this line of code in WifiWizard2.java
int updatedNetID = wifiManager.updateNetwork(wifi);
MY CODE
FRESH REBOOT - 1st time running
running same code a 2nd time
The text was updated successfully, but these errors were encountered: