Closed Goncalo-Almeida closed 6 years ago
Hi @pawelDylag, I saw you solved issue 32 and decided to test how this would impact the issues I have opened.
I've just tested version 0.4.1
of the Proximity SDK and, although the app still crashes, I'm now getting this exception:
FATAL EXCEPTION: RxCachedThreadScheduler-14
Process: pt.mobile.vasp.beacontestapp, PID: 8004
java.lang.IllegalStateException: Unable to create bluetooth LE scanner instance
at com.estimote.scanning_plugin.packet_provider.scanner.AlwaysErrorEstimoteScaner.scan(AlwaysErrorEstimoteScaner.kt:13)
at com.estimote.scanning_plugin.packet_provider.use_cases.EstimoteSecureScanUseCase.run(EstimoteSecureScanUseCase.kt:20)
at com.estimote.scanning_plugin.packet_provider.EstimotePacketProvider.provideEstimoteSecure(EstimotePacketProvider.kt:97)
at com.estimote.scanning_plugin.api.EstimoteBluetoothScanner$estimoteSecureScan$1.invoke(EstimoteBluetoothScanner.kt:46)
at com.estimote.scanning_plugin.api.EstimoteBluetoothScanner$estimoteSecureScan$1.invoke(EstimoteBluetoothScanner.kt:10)
at com.estimote.scanning_plugin.api.use_cases.ScanUseCase$scanForPacketsAccordingToSettings$1.apply(ScanUseCase.kt:22)
at com.estimote.scanning_plugin.api.use_cases.ScanUseCase$scanForPacketsAccordingToSettings$1.apply(ScanUseCase.kt:8)
at io.reactivex.internal.operators.observable.ObservableScalarXMap$ScalarXMapObservable.subscribeActual(ObservableScalarXMap.java:142)
at io.reactivex.Observable.subscribe(Observable.java:10903)
at io.reactivex.Observable.subscribe(Observable.java:10889)
at io.reactivex.Observable.subscribe(Observable.java:10818)
at com.estimote.scanning_plugin.api.use_cases.ScanUseCase.notifyUserCallbacks(ScanUseCase.kt:28)
at com.estimote.scanning_plugin.api.use_cases.ScanUseCase.run(ScanUseCase.kt:14)
at com.estimote.scanning_plugin.api.scan_launchers.BaseScannerScanLauncher.start(BaseScannerScanLauncher.kt:25)
at com.estimote.scanning_plugin.api.scan_launchers.BaseScannerScanLauncher.start(BaseScannerScanLauncher.kt:8)
at com.estimote.proximity_sdk.monitoring.estimote_monitoring.secure.SecureEstimoteMonitor$startEstimoteSecureScanResolving$1.subscribe(SecureEstimoteMonitor.kt:47)
at io.reactivex.internal.operators.observable.ObservableCreate.subscribeActual(ObservableCreate.java:40)
at io.reactivex.Observable.subscribe(Observable.java:10903)
at io.reactivex.internal.operators.observable.ObservableGroupBy.subscribeActual(ObservableGroupBy.java:48)
at io.reactivex.Observable.subscribe(Observable.java:10903)
at io.reactivex.internal.operators.observable.ObservableMap.subscribeActual(ObservableMap.java:33)
at io.reactivex.Observable.subscribe(Observable.java:10903)
at io.reactivex.internal.operators.observable.ObservableFlatMap.subscribeActual(ObservableFlatMap.java:55)
at io.reactivex.Observable.subscribe(Observable.java:10903)
at io.reactivex.internal.operators.observable.ObservableFlatMap$MergeObserver.subscribeInner(ObservableFlatMap.java:162)
at io.reactivex.internal.operators.observable.ObservableFlatMap$MergeObserver.onNext(ObservableFlatMap.java:139)
at io.reactivex.internal.operators.observable.ObservableFromArray$FromArrayDisposable.run(ObservableFromArray.java:107)
at io.reactivex.internal.operators.observable.ObservableFromArray.subscribeActual(ObservableFromArray.java:36)
at io.reactivex.Observable.subscribe(Observable.java:10903)
at io.reactivex.internal.operators.observable.ObservableFlatMap.subscribeActual(ObservableFlatMap.java:55)
at io.reactivex.Observable.subscribe(Observable.java:10903)
at io.reactivex.internal.operators.observable.ObservablePublish.connect(ObservablePublish.java:116)
at io.reactivex.internal.operators.observable.ObservableRefCount.subscribeActual(ObservableRefCount.java:68)
at io.reactivex.Observable.subscribe(Observable.java:10903)
at io.reactivex.internal.operators.observable.ObservableFilter.subscribeActual(ObservableFilter.java:30)
at io.reactivex.Observable.subscribe(Observable.java:10903)
at io.reactivex.internal.operators.observable.ObservableMap.subscribeActual(ObservableMap.java:33)
at io.reactivex.Observable.subscribe(Observable.java:10903)
at io.reactivex.internal.operators.observable.ObservablePublish.connect(ObservablePublish.java:116)
03-16 09:53:22.415 8004-8829/pt.mobile.vasp.beacontestapp E/AndroidRuntime: at io.reactivex.internal.operators.observable.ObservableRefCount.subscribeActual(ObservableRefCount.java:68)
at io.reactivex.Observable.subscribe(Observable.java:10903)
at io.reactivex.internal.operators.observable.ObservableMap.subscribeActual(ObservableMap.java:33)
at io.reactivex.Observable.subscribe(Observable.java:10903)
at io.reactivex.internal.operators.observable.ObservableFlatMap$MergeObserver.subscribeInner(ObservableFlatMap.java:162)
at io.reactivex.internal.operators.observable.ObservableFlatMap$MergeObserver.onNext(ObservableFlatMap.java:139)
at io.reactivex.internal.operators.observable.ObservableFromArray$FromArrayDisposable.run(ObservableFromArray.java:107)
at io.reactivex.internal.operators.observable.ObservableFromArray.subscribeActual(ObservableFromArray.java:36)
at io.reactivex.Observable.subscribe(Observable.java:10903)
at io.reactivex.internal.operators.observable.ObservableFlatMap.subscribeActual(ObservableFlatMap.java:55)
at io.reactivex.Observable.subscribe(Observable.java:10903)
at io.reactivex.internal.operators.observable.ObservableMap.subscribeActual(ObservableMap.java:33)
at io.reactivex.Observable.subscribe(Observable.java:10903)
at io.reactivex.internal.operators.observable.ObservableMap.subscribeActual(ObservableMap.java:33)
at io.reactivex.Observable.subscribe(Observable.java:10903)
at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:452)
at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:61)
at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:52)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:272)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
03-16 09:53:22.443 8004-8800/pt.mobile.vasp.beacontestapp V/FA: Recording user engagement, ms: 5691
03-16 09:53:22.447 8004-8800/pt.mobile.vasp.beacontestapp V/FA: Connecting to remote service
03-16 09:53:22.452 8004-8035/pt.mobile.vasp.beacontestapp D/libc-netbsd: getaddrinfo: reports.crashlytics.com get result from proxy gai_error = 0
03-16 09:53:22.453 8004-8035/pt.mobile.vasp.beacontestapp I/System.out: [socket][13] connection reports.crashlytics.com/23.23.172.199:443;LocalPort=-1(10000)
[ 03-16 09:53:22.454 8004: 8035 D/ ]
[Posix_connect Debug]Process pt.mobile.vasp.beacontestapp :443
03-16 09:53:22.461 8004-8800/pt.mobile.vasp.beacontestapp V/FA: Activity paused, time: 332208896
03-16 09:53:22.469 8004-8800/pt.mobile.vasp.beacontestapp D/FA: Logging event (FE): user_engagement(_e), Bundle[{firebase_event_origin(_o)=auto, engagement_time_msec(_et)=5691, firebase_screen_class(_sc)=MainActivity, firebase_screen_id(_si)=8829751764027338470}]
03-16 09:53:22.492 8004-8829/pt.mobile.vasp.beacontestapp I/Process: Sending signal. PID: 8004 SIG: 9
I also have this error. It seems that sometimes, the Bluetooth stack is completely lost. Turning Bluetooth off and on doesn't change anything. The only reliable solution that I found is: toggling Airplane mode on and off (or rebooting the phone).
Hello guys,
Sorry for the delay, I was on my vacation last week. I'll be looking into this problem and will let you know about the progress soon :)
Thanks @Goncalo-Almeida for filling in all the necessary data - it's super helpful :)
Sure no problem! Let me know if I can help any further. I have few different smartphones where I can test stuff.
Oh, by the way - have you tried using our RequirementsChecker before starting your proximity observation? It should check for all the necessary requirements, such as BLE enabled.
I had the code using the RequirementsChecker commented out on the sample app, so I'm not sure how I tested it or why was is commented.
So, I've just tested it again and I can't seem to recreate the issue anymore. I'll be testing this on the actual App and the QA department will be testing this on multiple phones.
Could you leave the issue opened and I'll let you know how it goes? This should be done over the next few days. I'll keep you posted on any developments.
Hello guys,
When it comes to the scan error 2
, then according to the Android official documentation, the problem is with registering BLE scan callbacks in system's bluetooth service. Our SDK registers several of them for additional features like Estimote Secure Monitoring or Telemetry Data Gathering (your beacons' battery status etc). Some phones may not be able to handle that many callbacks, so they are throwing scan error 2
. There are two possible solutions for that, and I need a feedback from you if it helps:
ProximityObserver
object. There are two of them enabled by default - Telemetry scanning, and Estimote Secure Monitoring. If you don't need to use them, you can disable them like this:
proximityObserver = ProximityObserverBuilder(applicationContext, cloudCredentials)
...
.withEstimoteSecureMonitoringDisabled()
.withTelemetryReportingDisabled()
...
.build()
The above should reduce the number of BLE callbacks being registered in OS, thus reducing the possibility of Scan error 2
.
Lemme know if that helps :) Paweł
Hi Pawel,
Implement today solution 1. still on testings, however, before reporting we had number 2 implement long before, monitoring, telemetry and even analytics are disable, and still we saw a scan error 2, not always of course.
So with number 2 I can't say if it really reduced, so let's see how it work with number 1
thanks
Hey
Version 0.4.2
is now live - all uncaught errors should be now properly reported via onErrorAction
. No crashes should occur from now on :)
Let me know about any other problems you encounter!
Thank you. @pawelDylag
I am still having error code 2's and 4's depending on the device and the onErrorAction is still not catching them causing the estimote proximity library to just crash the app. This 0.4.2 does not seem to change anything.
Hey guys,
Pro tip to my future self - always check if you rebased and merged feature branch to master before releasing the new version 😆
Sorry for this, the version 0.4.3
should contain all the changes ^^
Regards, Paweł
Hi pawelDylag,
I am still having crash due to scan error code 2. right now i am using latest version 0.4.4 but result are same......... crash :(
Hey @santoshgrs
There is a difference between "crash" and "error". The fix prevents your app from crashing (uncaught exception being thrown) and instead reports this to your onErrorAction
(or log an error to the logcat by default).
The fix doesn't resolve error code 2
being thrown per se, but prevents your app from crashing when you get it. This is exactly an expected behaviour that @Goncalo-Almeida posted: Expected behavior: Either a warning or some error for the developer to deal with.
We will be focusing on fixing the source of scan error 2
in the later update.
Regards, Paweł
hi Pawel,
i'm currently using version 0.5.0, i'm facing the same issue, but i get the exception sometimes... from 5 executions 3 times i get the exception...
is there any news about this issue?
the thing goes worse, i need to have this as a service and when i put the code to get this working, the entire application crashes...
Hey @rothariger
It is impossible for me to diagnose your problem just from reading "the thing goes worse". What I essentially need is basic information, necessary to proceed further in solving the case. Please consider reporting a new issue and remember to fill in the template with all the necessary (for me) information.
Kind regards, Paweł
Hi All we've also hit this issue using 0.5.1 SDK. Here's our stack trace... Hi @pawelDylag please let me know what other info I can provide to help:
com.estimote.scanning_plugin.packet_provider.scanner.AlwaysErrorEstimoteScaner.scan (AlwaysErrorEstimoteScaner.kt:13) com.estimote.scanning_plugin.packet_provider.use_cases.EstimoteLocationScanUseCase.run (EstimoteLocationScanUseCase.kt:22) com.estimote.scanning_plugin.packet_provider.EstimotePacketProvider.provideEstimoteLocation (EstimotePacketProvider.kt:44) com.estimote.scanning_plugin.api.EstimoteBluetoothScanner$estimoteLocationScan$1.invoke (EstimoteBluetoothScanner.kt:16) com.estimote.scanning_plugin.api.EstimoteBluetoothScanner$estimoteLocationScan$1.invoke (EstimoteBluetoothScanner.kt:10) com.estimote.scanning_plugin.api.use_cases.ScanUseCase$scanForPacketsAccordingToSettings$1.apply (ScanUseCase.kt:22) com.estimote.scanning_plugin.api.use_cases.ScanUseCase$scanForPacketsAccordingToSettings$1.apply (ScanUseCase.kt:8) io.reactivex.internal.operators.observable.ObservableScalarXMap$ScalarXMapObservable.subscribeActual (ObservableScalarXMap.java:142) io.reactivex.Observable.subscribe (Observable.java:10903) io.reactivex.Observable.subscribe (Observable.java:10889) io.reactivex.Observable.subscribe (Observable.java:10818) com.estimote.scanning_plugin.api.use_cases.ScanUseCase.notifyUserCallbacks (ScanUseCase.kt:28) com.estimote.scanning_plugin.api.use_cases.ScanUseCase.run (ScanUseCase.kt:14) com.estimote.scanning_plugin.api.scan_launchers.BaseScannerScanLauncher.start (BaseScannerScanLauncher.kt:25) com.estimote.scanning_plugin.api.scan_launchers.BaseScannerScanLauncher.start (BaseScannerScanLauncher.kt:8) com.estimote.proximity_sdk.monitoring.estimote_monitoring.SimpleEstimoteMonitor$startEstimoteLocationScan$1.subscribe (SimpleEstimoteMonitor.kt:45) io.reactivex.internal.operators.observable.ObservableCreate.subscribeActual (ObservableCreate.java:40) io.reactivex.Observable.subscribe (Observable.java:10903) io.reactivex.internal.operators.observable.ObservablePublish.connect (ObservablePublish.java:116) io.reactivex.internal.operators.observable.ObservableRefCount.subscribeActual (ObservableRefCount.java:68) io.reactivex.Observable.subscribe (Observable.java:10903) io.reactivex.internal.operators.observable.ObservableFilter.subscribeActual (ObservableFilter.java:30) io.reactivex.Observable.subscribe (Observable.java:10903) io.reactivex.internal.operators.observable.ObservableMap.subscribeActual (ObservableMap.java:33) io.reactivex.Observable.subscribe (Observable.java:10903) io.reactivex.internal.operators.observable.ObservablePublish.connect (ObservablePublish.java:116) io.reactivex.internal.operators.observable.ObservableRefCount.subscribeActual (ObservableRefCount.java:68) io.reactivex.Observable.subscribe (Observable.java:10903) io.reactivex.internal.operators.observable.ObservableDebounceTimed.subscribeActual (ObservableDebounceTimed.java:40) io.reactivex.Observable.subscribe (Observable.java:10903) io.reactivex.internal.operators.observable.ObservableMap.subscribeActual (ObservableMap.java:33) io.reactivex.Observable.subscribe (Observable.java:10903) io.reactivex.internal.operators.observable.ObservableOnErrorNext.subscribeActual (ObservableOnErrorNext.java:38) io.reactivex.Observable.subscribe (Observable.java:10903) io.reactivex.internal.operators.observable.ObservableFlatMap$MergeObserver.subscribeInner (ObservableFlatMap.java:162) io.reactivex.internal.operators.observable.ObservableFlatMap$MergeObserver.onNext (ObservableFlatMap.java:139) io.reactivex.internal.operators.observable.ObservableFromArray$FromArrayDisposable.run (ObservableFromArray.java:107) io.reactivex.internal.operators.observable.ObservableFromArray.subscribeActual (ObservableFromArray.java:36) io.reactivex.Observable.subscribe (Observable.java:10903) io.reactivex.internal.operators.observable.ObservableFlatMap.subscribeActual (ObservableFlatMap.java:55) io.reactivex.Observable.subscribe (Observable.java:10903) io.reactivex.internal.operators.observable.ObservableMap.subscribeActual (ObservableMap.java:33) io.reactivex.Observable.subscribe (Observable.java:10903) io.reactivex.internal.operators.observable.ObservableMap.subscribeActual (ObservableMap.java:33) io.reactivex.Observable.subscribe (Observable.java:10903) io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run (ObservableSubscribeOn.java:96) io.reactivex.Scheduler$DisposeTask.run (Scheduler.java:452) io.reactivex.internal.schedulers.ScheduledRunnable.run (ScheduledRunnable.java:61) io.reactivex.internal.schedulers.ScheduledRunnable.call (ScheduledRunnable.java:52) java.util.concurrent.FutureTask.run (FutureTask.java:266) java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run (ScheduledThreadPoolExecutor.java:301) java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1162) java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:636) java.lang.Thread.run (Thread.java:764)
Issue seems to be not fixed for a very long time...
Still getting this error on a Nexus 6P with 8.1 with Proximity SDK version 1.0.3
@pawelDylag What is the fix for this ? I am not able to download 0.4.3
npm ERR! code ETARGET npm ERR! notarget No matching version found for @estimote/react-native-proximity@^0.4.3 npm ERR! notarget In most cases you or one of your dependencies are requesting npm ERR! notarget a package version that doesn't exist. npm ERR! notarget
npm ERR! A complete log of this run can be found in:
On 8.1.0 and getting the same persistent onScanFailed errorCode 2, nothing seems to fix it :$ - only option is to downgrade <8.0 ?
I'm still seeing this: override fun onStart() { Log.d("ScanDevice Activity", "onStart()") super.onStart()
when (checkSelfPermission(**this**, **Manifest.permission.ACCESS_COARSE_LOCATION**)) {
PackageManager.PERMISSION_GRANTED -> {
**bluetoothLeScanner**.startScan(**BleScanner**)
}
else -> requestPermissions(arrayOf(Manifest.permission.ACCESS_COARSE_LOCATION), 1)
}
}
bolded items are shown as error.
Or I guess the text in between is the error...
Prerequisites
Basic information
Estimote SDK version:
0.3.3
Android devices affected: 1.
Vodafone VFD 600
2.Vodafone VFD 610
3.BlackView BV6000
4.Samsung J3(2016)
Android OS version affected (same order as above): 1.
6.0.1
2.7.0
3.7.0
4.5.1.1
Beacon hardware version:
G1.8
Description
I'm getting an Exception that crashes the App when starting to scan for beacons. For some reason this happens mostly on the listed devices, but it is also possible to trigger on other devices by turning off and on the Bluetooth before and/or after the scanning starts. This can be a bit hard to reproduce, sorry I don't have more information on this.
After entering this state, it's very hard to make it stop. In some case I had to uninstall the App to stop the behaviour. This could be related to the fact that the App crashes and the
observationHandler.stop()
is never called, because onDestroy() is also never called. This is annoying because the notification keeps firing.Although the Bluetooth error code varies between 2 and 4, the problem seems to arise from the same place:
PostLollipopEstimoteScanner.kt:29
(Optional) Steps to reproduce:
Create a
ProximityObserver
My code:Expected behavior: Either a warning or some error for the developer to deal with.
Actual behavior: Application crashes
Additional information