-
Notifications
You must be signed in to change notification settings - Fork 582
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
Location Services disabled (code 4) even when Location Services are Activated - Android Pen #327
Comments
Could you make a snippet of code and post what does The library expects either |
Result of :
is
When I run:
the result is:
|
Please share:
Also, what is your target SDK? |
Configuration:
note: I've recently upgraded to 26 but I've tested before with 25 which was giving the same error. I've changed the request permission from ACCESS_COARSE_LOCATION to ACCESS_FINE_LOCATION but it stills gives the same error.
|
In the case of this dongle none of the network or gps providers seems to be available. Could you check for the
|
It's strange because in the menu you have "Device only" which corresponds to GPS, not the network. In available providers though, you have only "passive" and "network". What are your options when you press "MODE"? |
Ok, so without any change on the configuration the result of:
is
Now, changing mode from device (which was the default) to High Accuracy, the result is:
And now it's working, meaning that I receive the ScanResults. My question now is if this condition (about the providers) is really necessary cause, if permission ACCESS_COARSE_LOCATION is allowed, even with mode in "device" mode, the scan works. I know this cause I've tested to do it directly (with the android libs). This is will force to request the user to change this, which is one more barrier to use the app (or even not be able to use if it's a basic user). Looking forward for your thoughts. Anyway, thank you very much for your help and the Lib :). |
It looks like your provider settings are reversed.
Enabling location is required only in certain scenarios where:
This is to control user's privacy better (you're getting device MAC address, which you can use as a location tip). |
"This is to control user's privacy better (you're getting device MAC address, which you can use as a location tip)." Yes, I understand it. What I'm saying is that, using android libs, when I'm in device mode I also receive the ScanResult (Name of device + Mac address). But, you're probably right, it may be a device provider issue on this. Thanks for your help. Best |
This is to be considered if verification should be a configuration parameter for a scan. @dariuszseweryn What do you think? |
That is a good idea. |
Not sure, AFAIK you cannot disable "passive" at all from a menu setting. |
@ejbp Could you check the above? |
Result:
|
Hello @ejbp I have another trace on what could work for your case. Would you be so kind and check what does |
@ejbp Ping? :) P.S. Happy New Year! |
Sorry Darius. I was off during some days and I missed your post. I will try to answer asap. |
##Value for Device Only ##Value for Battery Saving ##Value for High Accuracy Let me know if you need any further debug. |
You have written that you have three different values. Which one corresponds to when the |
##When location is on && setting is Device Only ##When location is on && setting is Battery Saving ##When location is on && setting is High Accuracy ##When location is off |
I think we have a winner. Could you just repeat the below test:
for all cases from your above post? I would like to have those for comparison. Thank you 👍 |
|
Perfect! Thank you—your use-case should be addressed in |
As it turned out it is possible to detect what is the current status of the Location even on devices that are not phones.
@ejbp this is already fixed in the |
Thanks @dariuszseweryn . You're guys are the best. Looking forward to have the release notes and available to import into gradle. |
The official release should happen quite soon. In the meantime you can checkout the |
Error:
com.polidea.rxandroidble.exceptions.BleScanException: Location Services disabled (code 4)
Facts:
is in manifest and user accepts the checkSelfPermission.
Double checked:
I double checked it in settings and location services are enabled and the app is allowed to such permission.
Hardware && versions:
[ro.build.version.release]: [7.1.2]
[ro.build.version.sdk]: [25]
[ro.product.board]: [q8723bs]
[ro.product.brand]: [Amlogic]
[ro.product.cpu.abi]: [arm64-v8a]
[ro.product.cpu.abilist]: [arm64-v8a,armeabi-v7a,armeabi]
[ro.product.cpu.abilist32]: [armeabi-v7a,armeabi]
[ro.product.cpu.abilist64]: [arm64-v8a]
[ro.product.device]: [q8723bs]
[ro.product.firmware]: [00502001]
[ro.product.locale]: [en-US]
[ro.product.manufacturer]: [Amlogic]
[ro.product.model]: [H96 PRO]
[ro.product.name]: [q8723bs]
Hardware Link
I can't figure out the reason of this exception. Any idea?
The text was updated successfully, but these errors were encountered: