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
didExitRegion called when goes to background in Google Pixel #509
Comments
Thanks for the report, @roshanparmar. Can you please attach a log with beaconManager.setDebug(true); that shows the exit event and prior 20 seconds? |
By the way there were some changes in 2.10 to fix some edge cases with Android 7.0 blocking too many scans in a short period of time. The problem you describe might be intermittently triggered with 2.9.2 using the 1000ms on / 1000 ms off scan settings you have in your code. But I would not expect it to happen consistently. Regardless, it may be worth verifying it still happens with 2.10. |
Sorry you are having trouble, @roshanparmar, and thank you for attaching the log. The log shows no detections in the background at all, but indicates that beacons had been previously detected, perhaps in the foreground. A. few possible causes:
It may be that setting a 1000 ms scan cycle may be too short to ever allow low power detections to succeed.
Please try the items above and let me know your findings so I may assist further. |
@roshanparmar, I believe I see the issue from the latest log. See this:
That indicates the app has not gotten location permission needed to detect BLE devices. You can read more about how to do this here: http://altbeacon.github.io/android-beacon-library/requesting_permission.html On Android 6+, apps that target SDK 23+ but fail to get this permission can not scan for BLE devices at all. Apps that target SDKs less than 23 and fail to get this permission can only scan in the foreground. I believe this is the problem that is causing your failure to scan in the background. |
2.11-beta1 is not on JCenter. You must download the binary manuallly, but it in a libs folder in your project and reference it that way. I will put up instructions in a bit and then review your latest logs. |
Beta release updated with configuration instructions: https://github.com/AltBeacon/android-beacon-library/releases/tag/2.11-beta1 |
@roshanparmar, a few more thoughts:
|
Sorry, the string in the instructions was incorrect. Please replace the dash before the version number with a colon like this: 'android-beacon-library:2.11-beta1@aar' |
If you can get this configured, please verify from the logs that you are using this version by looking for this line:
|
@roshanparmar, can you please attache a log showing the prior 30 seconds before the unexpected region exit when running 2.11-beta1? |
Troubleshooting errors on client devices where you don't have physical access is always really hard. The best thing I can suggest is to ask you client to send you a bug report, but this requires your client to turn on Developer tools on the Android device. If developer tools are enabled, you can send a bug report by going to Settings -> Developer Options -> Take Bug Report. After tapping this, there will be a delay of a few seconds to a few minutes (!) until it is ready at which time a notification will be sent. Tapping that notification will allow you to send the bug report via email. The bug report includes recent logs as well as other state info about the Android device. The trickiest part of doing this is getting your client to capture the bug report at the right time. If this is done too late, the logs won't show the desired information. |
Yes, as discussed above, this is a known issue with 2.10 for an app in the background when beacons are continuously around. The fix is included in 2.11-beta1. |
@roshanparmar, the logs indicate 2.10 is active:
|
@roshanparmar, sorry, this is getting confusing to follow. It's really important to focus on one issue at a time, so this thread doesn't go off track. Otherwise I cannot help. This issue was opened about background region exits using:
And not about using Please only post logs in this thread that use this setup from the start of the question, otherwise I won't be able to understand what is going on:
For any log you post, I also need to know what library version was running. I can't tell that from the most recent Pixel log you posted above, as there is no log line that shows the version. Is one of these logs using only the regionBootstrap setup code described above and using version 2.11-beta1 of the library? |
Looking at the latest log for the pixel that run from I don't see any region exits in the log. |
@roshanparmar, I have built a test case with steps to reproduce this problem and prove that it is fixed with 2.11-beta1. Details are in #512. Using the reference app to reproduce the problem allows us to have a test case that more than one person can run. If you think your problem reported here is not fixed as described in #512, please help create a reproducible test case with the reference app. |
Sorry, @roshanparmar, I do not think I can help debug your app as I do not have the source code and many things can cause the symptoms you describe. If you suspect the problem is with the library, please try to reproduce the problem with a minimal code example starting with the reference app. See here for my tests showing I do not get spurious region exits: Can you reproduce your problem with that reference project? A couple of tips on your above comments:
java.lang.SecurityException: Need ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION permission to get scan results |
I am using AltBeacon library to use iBeacon in my Android application but getting an issue, explained below
The text was updated successfully, but these errors were encountered: