mauron85 / react-native-background-geolocation

Background and foreground geolocation plugin for React Native. Tracks user when app is running in background.
Apache License 2.0
1.33k stars 562 forks source link

App crashed on example. #125

Closed hstemplewski closed 6 years ago

hstemplewski commented 6 years ago

Your Environment

Context

Expected Behavior

App not close and crashed

Actual Behavior

App crashed immediately.

Possible Fix

Steps to Reproduce

  1. Install lib
  2. try to implement config and start like in https://github.com/mauron85/react-native-background-geolocation/issues/79#issuecomment-305970565 (Redux version) 3.Start App 4.When app go to component which start location app crash

Context

Debug logs

I/com.marianhello.react.BackgroundGeolocationModule(10220): Initializing plugin
D/ReactNative(10220): Initializing React Xplat Bridge.
D/ReactNative(10220): Initializing React Xplat Bridge before initializeBridge
D/ReactNative(10220): Initializing React Xplat Bridge after initializeBridge
D/ReactNative(10220): CatalystInstanceImpl.runJSBundle()
D/ReactNative(10220): ReactInstanceManager.setupReactContext()
D/ReactNative(10220): CatalystInstanceImpl.initialize()
W/unknown:ReactNative(10220): Packager connection already open, nooping.
W/unknown:ReactNative(10220): Inspector connection already open, nooping.
I/com.marianhello.react.BackgroundGeolocationModule(10220): App will be resumed
D/ReactNative(10220): ReactInstanceManager.attachRootViewToInstance()
E/Vold    (  287): Failed to find mounted volume for /storage/sdcard1/Android/data/com.peppertech/files/
W/Vold    (  287): Returning OperationFailed - no handler for errno 0
W/ContextImpl(10220): Failed to ensure directory: /storage/sdcard1/Android/data/com.peppertech/files
I/WebViewFactory(10220): Loading com.google.android.webview version 42.0.2311.138 (code 52311138)
I/LibraryLoader(10220): Time to load native libraries: 2 ms (timestamps 6907-6909)
I/LibraryLoader(10220): Expected native library version number "",actual native library version number ""
W/art     (10220): Attempt to remove local handle scope entry from IRT, ignoring
D/com.marianhello.bgloc.data.sqlite.SQLiteConfigurationDAO(10220): Configuration persisted with rowId = 1
D/com.marianhello.react.BackgroundGeolocationModule(10220): Service configured with: Config[distanceFilter=50 stationaryRadius=50.0 desiredAccuracy=10 interval=10000 fastestInterval=5000 activitiesInterval=10000 isDebugging=true stopOnTerminate=false stopOnStillActivity=false startOnBoot=false startForeground=true locationProvider=1 nTitle=Background tracking nText=enabled nIconLarge= nIconSmall= nIconColor= url=http://192.168.81.15:3000/location syncUrl= syncThreshold=100 httpHeaders={X-FOO=bar} maxLocations=10000]
D/audio_hw_primary(  303): out_standby: enter: stream (0xab11dfe8) usecase(2: low-latency-playback)
D/effect_intf(  303): remove_active_usecase: Remove effect handle, usecase ID 2
D/hardware_info(  303): hw_info_append_hw_type : device_name = speaker
W/unknown:ViewManagerPropertyUpdater(10220): Could not find generated setter for class com.facebook.react.views.text.ReactVirtualTextShadowNode
D/TaskPersister(  879): removeObsoleteFile: deleting file=357_task.xml
D/TaskPersister(  879): removeObsoleteFile: deleting file=357_task_thumbnail.png
I/wpa_supplicant( 1259): wlan0: Control interface command 'SIGNAL_POLL'
D/WifiWatchdogStateMachine(  879): RSSI current: 4 new: -56, 4
D/StatusBar.NetworkController( 1348): hasService: mServiceState=2 1 home null null null  Unknown Unknown CSS not supported -1 -1 RoamInd=-1 DefRoamInd=-1 EmergOnly=true retVal=false
D/StatusBar.NetworkController( 1348): refreshViews: Data not connected!! Set no data type icon / Roaming
D/StatusBar.NetworkController( 1348): refreshViews connected={ wifi } level=4 combinedSignalIconId=0x7f020399/com.android.systemui:drawable/stat_sys_wifi_signal_4_fully combinedActivityIconId=0x7f02038e mobileLabel=Emergency calls only wifiLabel="office"xxxxXXXXxxxxXXXX emergencyOnly=true combinedLabel="office"xxxxXXXXxxxxXXXX mAirplaneMode=false mDataActivity=0 mPhoneSignalIconId=0x7f020378/com.android.systemui:drawable/stat_sys_signal_null mQSPhoneSignalIconId=0x7f0200ae/com.android.systemui:drawable/ic_qs_signal_no_signal mDataDirectionIconId=0x0/(null) mDataSignalIconId=0x7f020378/com.android.systemui:drawable/stat_sys_signal_null mDataTypeIconId=0x0/(null) mQSDataTypeIconId=0x0/(null) mNoSimIconId=0x7f0201b5/com.android.systemui:drawable/stat_sys_no_sim mWifiIconId=0x7f020399/com.android.systemui:drawable/stat_sys_wifi_signal_4_fully mQSWifiIconId=0x7f0200c4/com.android.systemui:drawable/ic_qs_wifi_full_4 mWifiActivityIconId=0x7f02038e/com.android.systemui:drawable/stat_sys_wifi_inout mBluetoothTetherIconId=0x108077d/android:drawable/stat_sys_tether_bluetooth
I/MSM-irqbalance(  408): Decided to move IRQ104 from CPU7 to CPU5
D/Ulp_jni (  879): Location CB invoked
E/QCOMSysDaemon(10316): Can't find/open bootselect node: (No such file or directory)
I/QCOMSysDaemon(10316): Starting qcom system daemon
E/QCOMSysDaemon(10316):  Diag_LSM_Init failed : 0
I/ANDR-PERF-MPCTL(10220): MPCTL client send 2
I/ANDR-PERF-MPCTL(10220): PERFLOCK client_comsoc: 69 time left on select, secs: 0, usecs: 999172
I/wpa_supplicant( 1259): wlan0: Control interface command 'SIGNAL_POLL'
D/WifiWatchdogStateMachine(  879): RSSI current: 4 new: -55, 4
D/StatusBar.NetworkController( 1348): hasService: mServiceState=2 1 home null null null  Unknown Unknown CSS not supported -1 -1 RoamInd=-1 DefRoamInd=-1 EmergOnly=true retVal=false
D/StatusBar.NetworkController( 1348): refreshViews: Data not connected!! Set no data type icon / Roaming
D/StatusBar.NetworkController( 1348): refreshViews connected={ wifi } level=4 combinedSignalIconId=0x7f020399/com.android.systemui:drawable/stat_sys_wifi_signal_4_fully combinedActivityIconId=0x7f02038e mobileLabel=Emergency calls only wifiLabel="office"xxxxXXXXxxxxXXXX emergencyOnly=true combinedLabel="office"xxxxXXXXxxxxXXXX mAirplaneMode=false mDataActivity=0 mPhoneSignalIconId=0x7f020378/com.android.systemui:drawable/stat_sys_signal_null mQSPhoneSignalIconId=0x7f0200ae/com.android.systemui:drawable/ic_qs_signal_no_signal mDataDirectionIconId=0x0/(null) mDataSignalIconId=0x7f020378/com.android.systemui:drawable/stat_sys_signal_null mDataTypeIconId=0x0/(null) mQSDataTypeIconId=0x0/(null) mNoSimIconId=0x7f0201b5/com.android.systemui:drawable/stat_sys_no_sim mWifiIconId=0x7f020399/com.android.systemui:drawable/stat_sys_wifi_signal_4_fully mQSWifiIconId=0x7f0200c4/com.android.systemui:drawable/ic_qs_wifi_full_4 mWifiActivityIconId=0x7f02038e/com.android.systemui:drawable/stat_sys_wifi_inout mBluetoothTetherIconId=0x108077d/android:drawable/stat_sys_tether_bluetooth
I/ANDR-PERF-MPCTL(10220): MPCTL client send 2
I/ANDR-PERF-MPCTL(10220): PERFLOCK client_comsoc: 70 time left on select, secs: 0, usecs: 999015
I/wpa_supplicant( 1259): wlan0: Control interface command 'SIGNAL_POLL'
D/WifiWatchdogStateMachine(  879): RSSI current: 4 new: -56, 4
D/StatusBar.NetworkController( 1348): hasService: mServiceState=2 1 home null null null  Unknown Unknown CSS not supported -1 -1 RoamInd=-1 DefRoamInd=-1 EmergOnly=true retVal=false
D/StatusBar.NetworkController( 1348): refreshViews: Data not connected!! Set no data type icon / Roaming
D/StatusBar.NetworkController( 1348): refreshViews connected={ wifi } level=4 combinedSignalIconId=0x7f020399/com.android.systemui:drawable/stat_sys_wifi_signal_4_fully combinedActivityIconId=0x7f02038e mobileLabel=Emergency calls only wifiLabel="office"xxxxXXXXxxxxXXXX emergencyOnly=true combinedLabel="office"xxxxXXXXxxxxXXXX mAirplaneMode=false mDataActivity=0 mPhoneSignalIconId=0x7f020378/com.android.systemui:drawable/stat_sys_signal_null mQSPhoneSignalIconId=0x7f0200ae/com.android.systemui:drawable/ic_qs_signal_no_signal mDataDirectionIconId=0x0/(null) mDataSignalIconId=0x7f020378/com.android.systemui:drawable/stat_sys_signal_null mDataTypeIconId=0x0/(null) mQSDataTypeIconId=0x0/(null) mNoSimIconId=0x7f0201b5/com.android.systemui:drawable/stat_sys_no_sim mWifiIconId=0x7f020399/com.android.systemui:drawable/stat_sys_wifi_signal_4_fully mQSWifiIconId=0x7f0200c4/com.android.systemui:drawable/ic_qs_wifi_full_4 mWifiActivityIconId=0x7f02038e/com.android.systemui:drawable/stat_sys_wifi_inout mBluetoothTetherIconId=0x108077d/android:drawable/stat_sys_tether_bluetooth
I/MSM-irqbalance(  408): Decided to move IRQ131 from CPU7 to CPU5
E/QCOMSysDaemon(10400): Can't find/open bootselect node: (No such file or directory)
I/QCOMSysDaemon(10400): Starting qcom system daemon
E/QCOMSysDaemon(10400):  Diag_LSM_Init failed : 0
I/ANDR-PERF-MPCTL(10220): MPCTL client send 2
I/ANDR-PERF-MPCTL(10220): PERFLOCK client_comsoc: 77 time left on select, secs: 0, usecs: 999230
I/wpa_supplicant( 1259): wlan0: Control interface command 'SIGNAL_POLL'
D/WifiWatchdogStateMachine(  879): RSSI current: 4 new: -57, 4
D/StatusBar.NetworkController( 1348): hasService: mServiceState=2 1 home null null null  Unknown Unknown CSS not supported -1 -1 RoamInd=-1 DefRoamInd=-1 EmergOnly=true retVal=false
D/StatusBar.NetworkController( 1348): refreshViews: Data not connected!! Set no data type icon / Roaming
D/StatusBar.NetworkController( 1348): refreshViews connected={ wifi } level=4 combinedSignalIconId=0x7f020399/com.android.systemui:drawable/stat_sys_wifi_signal_4_fully combinedActivityIconId=0x7f02038e mobileLabel=Emergency calls only wifiLabel="office"xxxxXXXXxxxxXXXX emergencyOnly=true combinedLabel="office"xxxxXXXXxxxxXXXX mAirplaneMode=false mDataActivity=0 mPhoneSignalIconId=0x7f020378/com.android.systemui:drawable/stat_sys_signal_null mQSPhoneSignalIconId=0x7f0200ae/com.android.systemui:drawable/ic_qs_signal_no_signal mDataDirectionIconId=0x0/(null) mDataSignalIconId=0x7f020378/com.android.systemui:drawable/stat_sys_signal_null mDataTypeIconId=0x0/(null) mQSDataTypeIconId=0x0/(null) mNoSimIconId=0x7f0201b5/com.android.systemui:drawable/stat_sys_no_sim mWifiIconId=0x7f020399/com.android.systemui:drawable/stat_sys_wifi_signal_4_fully mQSWifiIconId=0x7f0200c4/com.android.systemui:drawable/ic_qs_wifi_full_4 mWifiActivityIconId=0x7f02038e/com.android.systemui:drawable/stat_sys_wifi_inout mBluetoothTetherIconId=0x108077d/android:drawable/stat_sys_tether_bluetooth
I/MSM-irqbalance(  408): Decided to move IRQ215 from CPU7 to CPU5
I/ANDR-PERF-MPCTL(10220): MPCTL client send 2
I/ANDR-PERF-MPCTL(10220): PERFLOCK client_comsoc: 69 time left on select, secs: 0, usecs: 999969
D/Ulp_jni (  879): Location CB invoked
E/QCOMSysDaemon(10480): Can't find/open bootselect node: (No such file or directory)
I/QCOMSysDaemon(10480): Starting qcom system daemon
E/QCOMSysDaemon(10480):  Diag_LSM_Init failed : 0
D/RNFirebaseAuth(10220): addAuthStateListener
D/RNFirebaseAuth(10220): addIdTokenListener
D/RNFirebaseAuth(10220): signInWithEmailAndPassword
I/wpa_supplicant( 1259): wlan0: Control interface command 'SIGNAL_POLL'
I/art     (  879): Explicit concurrent mark sweep GC freed 56131(2MB) AllocSpace objects, 4(1200KB) LOS objects, 33% free, 26MB/39MB, paused 2.592ms total 278.716ms
D/WifiWatchdogStateMachine(  879): RSSI current: 4 new: -56, 4
D/StatusBar.NetworkController( 1348): hasService: mServiceState=2 1 home null null null  Unknown Unknown CSS not supported -1 -1 RoamInd=-1 DefRoamInd=-1 EmergOnly=true retVal=false
D/StatusBar.NetworkController( 1348): refreshViews: Data not connected!! Set no data type icon / Roaming
D/StatusBar.NetworkController( 1348): refreshViews connected={ wifi } level=4 combinedSignalIconId=0x7f020399/com.android.systemui:drawable/stat_sys_wifi_signal_4_fully combinedActivityIconId=0x7f02038e mobileLabel=Emergency calls only wifiLabel="office"xxxxXXXXxxxxXXXX emergencyOnly=true combinedLabel="office"xxxxXXXXxxxxXXXX mAirplaneMode=false mDataActivity=0 mPhoneSignalIconId=0x7f020378/com.android.systemui:drawable/stat_sys_signal_null mQSPhoneSignalIconId=0x7f0200ae/com.android.systemui:drawable/ic_qs_signal_no_signal mDataDirectionIconId=0x0/(null) mDataSignalIconId=0x7f020378/com.android.systemui:drawable/stat_sys_signal_null mDataTypeIconId=0x0/(null) mQSDataTypeIconId=0x0/(null) mNoSimIconId=0x7f0201b5/com.android.systemui:drawable/stat_sys_no_sim mWifiIconId=0x7f020399/com.android.systemui:drawable/stat_sys_wifi_signal_4_fully mQSWifiIconId=0x7f0200c4/com.android.systemui:drawable/ic_qs_wifi_full_4 mWifiActivityIconId=0x7f02038e/com.android.systemui:drawable/stat_sys_wifi_inout mBluetoothTetherIconId=0x108077d/android:drawable/stat_sys_tether_bluetooth
I/AuthChimeraService(28614): Executing request: ProxyRequest[ url: https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyPassword?alt=proto&key=AIzaSyBYDPJconKrTgJ9CvU1lkqqvGKU8nzeabg, method: 1 ]
I/AuthChimeraService(28614): Executing send connection operation
I/AlarmManager(  879): [FXN.ASD]set  [type=2 trigger on=(+13m24s682ms) repeatInt=0 repeatInt=PendingIntent{1d39b526: PendingIntentRecord{3e4be87d com.google.android.gms broadcastIntent}} worksource = WorkSource{10038 com.google.android.gms}]
I/AuthChimeraService(28614): Executing request: ProxyRequest[ url: https://www.googleapis.com/identitytoolkit/v3/relyingparty/getAccountInfo?alt=proto&key=AIzaSyBYDPJconKrTgJ9CvU1lkqqvGKU8nzeabg, method: 1 ]
I/AuthChimeraService(28614): Executing send connection operation
D/FirebaseAuth(10220): Notifying id token listeners about user ( luLoaDhHCEMcLSKOC9sy7BBjMrr1 ).
W/FirebaseAuth(28614): [PhoneNumberAuthPostProcessor] postProcess starts
W/FirebaseAuth(28614): [PhoneNumberAuthPostProcessor] postProcess ends
D/FirebaseApp(10220): Notifying auth state listeners.
D/FirebaseApp(10220): Notified 0 auth state listeners.
D/RNFirebaseAuth(10220): signInWithEmailAndPassword:onComplete:success
I/AlarmManager(  879): [FXN.ASD]set  [type=2 trigger on=(+13m24s383ms) repeatInt=0 repeatInt=PendingIntent{827e567: PendingIntentRecord{3e4be87d com.google.android.gms broadcastIntent}} worksource = WorkSource{10038 com.google.android.gms}]
W/ResourcesManager(10220): Asset path '/system/framework/com.android.media.remotedisplay.jar' does not exist or contains no resources.
W/ResourcesManager(10220): Asset path '/system/framework/com.android.location.provider.jar' does not exist or contains no resources.
I/art     (10220): Background sticky concurrent mark sweep GC freed 39472(3MB) AllocSpace objects, 2(32KB) LOS objects, 18% free, 13MB/16MB, paused 4.089ms total 102.927ms
V/NativeCrypto(10220): Registering com/google/android/gms/org/conscrypt/NativeCrypto's 276 native methods...
I/art     (10220): Rejecting re-init on previously-failed class java.lang.Class<com.google.android.gms.org.conscrypt.DelegatingExtendedSSLSession>
I/art     (10220): Rejecting re-init on previously-failed class java.lang.Class<com.google.android.gms.org.conscrypt.DelegatingExtendedSSLSession>
I/art     (10220): Rejecting re-init on previously-failed class java.lang.Class<com.google.android.gms.org.conscrypt.DelegatingExtendedSSLSession>
W/System  (10220): Could not create com.google.android.gms.org.conscrypt.OpenSSLSocketFactoryImpl with ClassLoader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.peppertech-2/base.apk"],nativeLibraryDirectories=[/data/app/com.peppertech-2/lib/arm, /vendor/lib, /system/lib]]]: com.google.android.gms.org.conscrypt.OpenSSLSocketFactoryImpl
I/ProviderInstaller(10220): Installed default security provider GmsCore_OpenSSL
I/AlarmManager(  879): trigger alam package=android type=0
E/WifiStateMachine(  879): WifiStateMachine CMD_START_SCAN source -2 txSuccessRate=141.02 rxSuccessRate=196.91 targetRoamBSSID=any RSSI=-56
E/WifiStateMachine(  879): WifiStateMachine CMD_START_SCAN with age=20003 interval=30000 maxinterval=300000
E/WifiStateMachine(  879): WifiStateMachine CMD_START_SCAN prevent full band scan due to pkt rate
E/WifiStateMachine(  879): WifiStateMachine CMD_START_SCAN source -2 ...and ignore scans tx=141.02 rx=196.91
I/art     (10220): Background partial concurrent mark sweep GC freed 34918(1934KB) AllocSpace objects, 1(39KB) LOS objects, 40% free, 14MB/23MB, paused 3.411ms total 160.710ms
D/RNFBFSDocumentReference(10220): get:onComplete:success
D/RNFirebaseStorage(10220): getDownloadURL path avatars/luLoaDhHCEMcLSKOC9sy7BBjMrr1.jpg
W/DynamiteModule(10220): Local module descriptor class for com.google.android.gms.firebasestorage not found.
I/DynamiteModule(10220): Considering local module com.google.android.gms.firebasestorage:0 and remote module com.google.android.gms.firebasestorage:6
I/DynamiteModule(10220): Selected remote version of com.google.android.gms.firebasestorage, version >= 6
I/wpa_supplicant( 1259): wlan0: Control interface command 'SIGNAL_POLL'
D/StatusBar.NetworkController( 1348): hasService: mServiceState=2 1 home null null null  Unknown Unknown CSS not supported -1 -1 RoamInd=-1 DefRoamInd=-1 EmergOnly=true retVal=false
D/StatusBar.NetworkController( 1348): refreshViews: Data not connected!! Set no data type icon / Roaming
D/WifiWatchdogStateMachine(  879): RSSI current: 4 new: -57, 4
D/StatusBar.NetworkController( 1348): refreshViews connected={ wifi } level=4 combinedSignalIconId=0x7f020399/com.android.systemui:drawable/stat_sys_wifi_signal_4_fully combinedActivityIconId=0x7f02038e mobileLabel=Emergency calls only wifiLabel="office"xxxxXXXXxxxxXXXX emergencyOnly=true combinedLabel="office"xxxxXXXXxxxxXXXX mAirplaneMode=false mDataActivity=0 mPhoneSignalIconId=0x7f020378/com.android.systemui:drawable/stat_sys_signal_null mQSPhoneSignalIconId=0x7f0200ae/com.android.systemui:drawable/ic_qs_signal_no_signal mDataDirectionIconId=0x0/(null) mDataSignalIconId=0x7f020378/com.android.systemui:drawable/stat_sys_signal_null mDataTypeIconId=0x0/(null) mQSDataTypeIconId=0x0/(null) mNoSimIconId=0x7f0201b5/com.android.systemui:drawable/stat_sys_no_sim mWifiIconId=0x7f020399/com.android.systemui:drawable/stat_sys_wifi_signal_4_fully mQSWifiIconId=0x7f0200c4/com.android.systemui:drawable/ic_qs_wifi_full_4 mWifiActivityIconId=0x7f02038e/com.android.systemui:drawable/stat_sys_wifi_inout mBluetoothTetherIconId=0x108077d/android:drawable/stat_sys_tether_bluetooth
I/art     (10220): DexFile_isDexOptNeeded failed to open oat file '/data/dalvik-cache/arm/data@data@com.google.android.gms@app_chimera@m@00000010@DynamiteModulesC_GmsCore_prodlmp_xhdpi_release.apk@classes.dex' for file location '/data/data/com.google.android.gms/app_chimera/m/00000010/DynamiteModulesC_GmsCore_prodlmp_xhdpi_release.apk': Failed to open oat filename for reading: No such file or directory
I/art     (10220): DexFile_isDexOptNeeded failed to open oat file '/data/data/com.google.android.gms/app_chimera/m/00000010/arm/DynamiteModulesC_GmsCore_prodlmp_xhdpi_release.odex' for file location '/data/data/com.google.android.gms/app_chimera/m/00000010/DynamiteModulesC_GmsCore_prodlmp_xhdpi_release.apk': Failed to open oat filename for reading: No such file or directory
I/MSM-irqbalance(  408): Decided to move IRQ57 from CPU7 to CPU5
E/QCOMSysDaemon(10574): Can't find/open bootselect node: (No such file or directory)
I/QCOMSysDaemon(10574): Starting qcom system daemon
E/QCOMSysDaemon(10574):  Diag_LSM_Init failed : 0
D/RNFBFSDocumentReference(10220): get:onComplete:success
D/RNFSCollectionReference(10220): get:onComplete:success
D/com.marianhello.react.BackgroundGeolocationModule(10220): Permissions granted
I/com.marianhello.react.BackgroundGeolocationModule(10220): Starting bg service
D/com.marianhello.react.BackgroundGeolocationModule(10220): Binding to service
I/com.marianhello.bgloc.LocationService(10220): Creating LocationService
W/AccountManagerService(  879): insertAccountIntoDatabase: Account {name=dummy, type=com.peppertech}, skipping since the account already exists
I/com.marianhello.bgloc.LocationService(10220): Received start startId: 1 intent: Intent { flg=0x4 cmp=com.peppertech/com.marianhello.bgloc.LocationService (has extras) }
I/com.marianhello.bgloc.LocationService(10220): Network condition changed hasConnectivity: true
D/com.marianhello.bgloc.LocationService(10220): Will start service with: Config[distanceFilter=50 stationaryRadius=50.0 desiredAccuracy=10 interval=10000 fastestInterval=5000 activitiesInterval=10000 isDebugging=true stopOnTerminate=false stopOnStillActivity=false startOnBoot=false startForeground=true locationProvider=1 nTitle=Background tracking nText=enabled nIconLarge= nIconSmall= nIconColor= url=http://192.168.81.15:3000/location syncUrl= syncThreshold=100 httpHeaders={X-FOO=bar} maxLocations=10000]
I/art     (10220): Rejecting re-init on previously-failed class java.lang.Class<com.marianhello.bgloc.ActivityRecognitionLocationProvider>
I/art     (10220): Rejecting re-init on previously-failed class java.lang.Class<com.marianhello.bgloc.ActivityRecognitionLocationProvider>
I/art     (10220): Rejecting re-init on previously-failed class java.lang.Class<com.marianhello.bgloc.ActivityRecognitionLocationProvider>
D/AndroidRuntime(10220): Shutting down VM
E/AndroidRuntime(10220): FATAL EXCEPTION: main
E/AndroidRuntime(10220): Process: com.peppertech, PID: 10220
E/AndroidRuntime(10220): java.lang.NoClassDefFoundError: com.marianhello.bgloc.ActivityRecognitionLocationProvider
E/AndroidRuntime(10220):        at com.marianhello.bgloc.LocationProviderFactory.getInstance(LocationProviderFactory.java:37)
E/AndroidRuntime(10220):        at com.marianhello.bgloc.LocationService.onStartCommand(LocationService.java:243)
E/AndroidRuntime(10220):        at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2908)
E/AndroidRuntime(10220):        at android.app.ActivityThread.access$2100(ActivityThread.java:145)
E/AndroidRuntime(10220):        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1421)
E/AndroidRuntime(10220):        at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(10220):        at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime(10220):        at android.app.ActivityThread.main(ActivityThread.java:5319)
E/AndroidRuntime(10220):        at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(10220):        at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime(10220):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1016)
E/AndroidRuntime(10220):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:811)
W/ActivityManager(  879):   Force finishing activity com.peppertech/.MainActivity
D/ForegroundUtils( 1655): Foreground changed, PID: 1798 UID: 10098 foreground: true
D/ForegroundUtils( 1655): Foreground UID/PID combinations:
D/ForegroundUtils( 1655): UID: 10098 PID: 1798
D/ForegroundUtils( 1655): UID: 10243 PID: 10220
I/tfsw    ( 3803): Foreground was changed: com.sonyericsson.home
I/tfsw    ( 3803): Inform user attribute 0x0 [ 0.000000 0.000000 -1.000000 -1.000000 ]
I/Process (10220): Sending signal. PID: 10220 SIG: 9
I/CrashMonitor(10917): CrashMonitorServiceBroadcastReceiver: Forwarding intent: android.intent.action.DROPBOX_ENTRY_ADDED tag: data_app_crash
I/CrashMonitor(10917): CrashMonitorService: Service started...
I/CrashMonitor(10917): CrashMonitorService: action: android.intent.action.DROPBOX_ENTRY_ADDED
E/CrashMonitor(10917): DropBoxHandler: crashhandler store: 
E/CrashMonitor(10917): DropBoxHandler: crashhandler store: for
E/CrashMonitor(10917): DropBoxHandler: crashhandler store: for
E/CrashMonitor(10917): DropBoxHandler: crashhandler store: for
I/CrashMonitor(10917): CrashMonitorService: Service stopped...
I/wpa_supplicant( 1259): wlan0: Control interface command 'SIGNAL_POLL'
D/WifiWatchdogStateMachine(  879): RSSI current: 4 new: -57, 4
D/StatusBar.NetworkController( 1348): hasService: mServiceState=2 1 home null null null  Unknown Unknown CSS not supported -1 -1 RoamInd=-1 DefRoamInd=-1 EmergOnly=true retVal=false
D/StatusBar.NetworkController( 1348): refreshViews: Data not connected!! Set no data type icon / Roaming
D/StatusBar.NetworkController( 1348): refreshViews connected={ wifi } level=4 combinedSignalIconId=0x7f020399/com.android.systemui:drawable/stat_sys_wifi_signal_4_fully combinedActivityIconId=0x7f02038e mobileLabel=Emergency calls only wifiLabel="office"xxxxXXXXxxxxXXXX emergencyOnly=true combinedLabel="office"xxxxXXXXxxxxXXXX mAirplaneMode=false mDataActivity=0 mPhoneSignalIconId=0x7f020378/com.android.systemui:drawable/stat_sys_signal_null mQSPhoneSignalIconId=0x7f0200ae/com.android.systemui:drawable/ic_qs_signal_no_signal mDataDirectionIconId=0x0/(null) mDataSignalIconId=0x7f020378/com.android.systemui:drawable/stat_sys_signal_null mDataTypeIconId=0x0/(null) mQSDataTypeIconId=0x0/(null) mNoSimIconId=0x7f0201b5/com.android.systemui:drawable/stat_sys_no_sim mWifiIconId=0x7f020399/com.android.systemui:drawable/stat_sys_wifi_signal_4_fully mQSWifiIconId=0x7f0200c4/com.android.systemui:drawable/ic_qs_wifi_full_4 mWifiActivityIconId=0x7f02038e/com.android.systemui:drawable/stat_sys_wifi_inout mBluetoothTetherIconId=0x108077d/android:drawable/stat_sys_tether_bluetooth
I/WindowState(  879): WIN DEATH: Window{23f09dbb u0 com.peppertech/com.peppertech.MainActivity}
D/bsthal  (  879): [Sensors] setDelay=> handle: 1598182229, delay: 222ms, index: 3, acc_enabled
D/bsthal  (  879): [Sensors]ns > 200000000
I/bsthal  (  879): [Sensors] disable sensor <BOSCH Acceleration Sensor>
D/bsthal  (  879): [Sensors] virtual int BMA2X2Sensor::enable(int32_t, int):en=1, handle=1598182229, ID_A=1598182229, mEnabled=1
I/bsthal  (  879): [Sensors]BMA2X2Sensor::setDelay virtual int BMA2X2Sensor::setDelay(int32_t, int64_t):ms=222, handle=1598182229, ID_A=1598182229, mDelay=66667000, mInterrupt=0, mEnabled=1
I/WindowState(  879): WIN DEATH: Window{295e776f u0 com.peppertech}
I/ActivityManager(  879): Process com.peppertech (pid 10220) has died
W/ActivityManager(  879): Scheduling restart of crashed service com.peppertech/com.marianhello.bgloc.LocationService in 1000ms
D/ForegroundUtils( 1655): Process died; UID 10243 PID 10220
D/ForegroundUtils( 1655): Foreground changed, PID: 10220 UID: 10243 foreground: false
D/ForegroundUtils( 1655): Foreground UID/PID combinations:
D/ForegroundUtils( 1655): UID: 10098 PID: 1798
D/PhoneApp( 1775): getPhone phoneId:0
W/InputMethodManagerService(  879): Got RemoteException sending setActive(false) notification to pid 10220 uid 10243
I/Timeline( 1798): Timeline: Activity_idle id: android.os.BinderProxy@4a75287 time:46446226
I/Timeline(  879): Timeline: Activity_windows_visible id: ActivityRecord{636a085 u0 com.sonyericsson.home/com.sonymobile.home.HomeActivity t297} time:46446477
I/art     (10600): Late-enabling -Xcheck:jni
I/ActivityManager(  879): Start proc com.peppertech for service com.peppertech/com.marianhello.bgloc.LocationService: pid=10600 uid=10243 gids={50243, 9997, 3003, 1028, 1015} abi=armeabi-v7a
W/DynamiteModule(10600): Local module descriptor class for com.google.firebase.auth not found.
I/FA      (10600): App measurement is starting up, version: 11400
I/FA      (10600): To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
W/DynamiteModule(10600): Local module descriptor class for com.google.firebase.auth not found.
I/FA      (10600): To enable faster debug mode event logging run:
I/FA      (10600):   adb shell setprop debug.firebase.analytics.app com.peppertech
I/FirebaseInitProvider(10600): FirebaseApp initialization successful
V/fb-UnpackingSoSource(10600): locked dso store /data/data/com.peppertech/lib-main
I/fb-UnpackingSoSource(10600): dso store is up-to-date: /data/data/com.peppertech/lib-main
V/fb-UnpackingSoSource(10600): releasing dso store lock for /data/data/com.peppertech/lib-main
I/com.marianhello.bgloc.LocationService(10600): Creating LocationService
D/StatusBar.NetworkController( 1348): hasService: mServiceState=2 1 home null null null  Unknown Unknown CSS not supported -1 -1 RoamInd=-1 DefRoamInd=-1 EmergOnly=true retVal=false
D/StatusBar.NetworkController( 1348): refreshViews: Data not connected!! Set no data type icon / Roaming
D/StatusBar.NetworkController( 1348): refreshViews connected={ wifi } level=4 combinedSignalIconId=0x7f020399/com.android.systemui:drawable/stat_sys_wifi_signal_4_fully combinedActivityIconId=0x7f02038d mobileLabel=Emergency calls only wifiLabel="office"xxxxXXXXxxxxXXXX emergencyOnly=true combinedLabel="office"xxxxXXXXxxxxXXXX mAirplaneMode=false mDataActivity=0 mPhoneSignalIconId=0x7f020378/com.android.systemui:drawable/stat_sys_signal_null mQSPhoneSignalIconId=0x7f0200ae/com.android.systemui:drawable/ic_qs_signal_no_signal mDataDirectionIconId=0x0/(null) mDataSignalIconId=0x7f020378/com.android.systemui:drawable/stat_sys_signal_null mDataTypeIconId=0x0/(null) mQSDataTypeIconId=0x0/(null) mNoSimIconId=0x7f0201b5/com.android.systemui:drawable/stat_sys_no_sim mWifiIconId=0x7f020399/com.android.systemui:drawable/stat_sys_wifi_signal_4_fully mQSWifiIconId=0x7f0200c4/com.android.systemui:drawable/ic_qs_wifi_full_4 mWifiActivityIconId=0x7f02038d/com.android.systemui:drawable/stat_sys_wifi_in mBluetoothTetherIconId=0x108077d/android:drawable/stat_sys_tether_bluetooth
D/StatusBar.NetworkController( 1348): refreshSignalCluster - setMobileDataIndicators:  mHasMobileDataFeature = true mPhoneSignalIconId = com.android.systemui:drawable/stat_sys_signal_null mDataSignalIconId = com.android.systemui:drawable/stat_sys_signal_null mMobileActivityIconId = (null) mDataTypeIconId = (null) mNoSimIconId = com.android.systemui:drawable/stat_sys_no_sim
D/StatusBar.NetworkController( 1348): refreshSignalCluster - setMobileDataIndicators:  mHasMobileDataFeature = true mPhoneSignalIconId = com.android.systemui:drawable/stat_sys_signal_null mDataSignalIconId = com.android.systemui:drawable/stat_sys_signal_null mMobileActivityIconId = (null) mDataTypeIconId = (null) mNoSimIconId = com.android.systemui:drawable/stat_sys_no_sim
D/StatusBar.NetworkController( 1348): refreshSignalCluster - setMobileDataIndicators:  mHasMobileDataFeature = true mPhoneSignalIconId = com.android.systemui:drawable/stat_sys_signal_null mDataSignalIconId = com.android.systemui:drawable/stat_sys_signal_null mMobileActivityIconId = (null) mDataTypeIconId = (null) mNoSimIconId = com.android.systemui:drawable/stat_sys_no_sim
D/StatusBar.NetworkController( 1348): changing data overlay icon id to 2130838413
W/AccountManagerService(  879): insertAccountIntoDatabase: Account {name=dummy, type=com.peppertech}, skipping since the account already exists
I/com.marianhello.bgloc.LocationService(10600): Received start startId: 1 intent: Intent { flg=0x4 cmp=com.peppertech/com.marianhello.bgloc.LocationService (has extras) }
I/com.marianhello.bgloc.LocationService(10600): Network condition changed hasConnectivity: true
D/com.marianhello.bgloc.LocationService(10600): Will start service with: Config[distanceFilter=50 stationaryRadius=50.0 desiredAccuracy=10 interval=10000 fastestInterval=5000 activitiesInterval=10000 isDebugging=true stopOnTerminate=false stopOnStillActivity=false startOnBoot=false startForeground=true locationProvider=1 nTitle=Background tracking nText=enabled nIconLarge= nIconSmall= nIconColor= url=http://192.168.81.15:3000/location syncUrl= syncThreshold=100 httpHeaders={X-FOO=bar} maxLocations=10000]
I/art     (10600): Rejecting re-init on previously-failed class java.lang.Class<com.marianhello.bgloc.ActivityRecognitionLocationProvider>
I/art     (10600): Rejecting re-init on previously-failed class java.lang.Class<com.marianhello.bgloc.ActivityRecognitionLocationProvider>
I/art     (10600): Rejecting re-init on previously-failed class java.lang.Class<com.marianhello.bgloc.ActivityRecognitionLocationProvider>
D/AndroidRuntime(10600): Shutting down VM
E/AndroidRuntime(10600): FATAL EXCEPTION: main
E/AndroidRuntime(10600): Process: com.peppertech, PID: 10600
E/AndroidRuntime(10600): java.lang.NoClassDefFoundError: com.marianhello.bgloc.ActivityRecognitionLocationProvider
E/AndroidRuntime(10600):        at com.marianhello.bgloc.LocationProviderFactory.getInstance(LocationProviderFactory.java:37)
E/AndroidRuntime(10600):        at com.marianhello.bgloc.LocationService.onStartCommand(LocationService.java:243)
E/AndroidRuntime(10600):        at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2908)
E/AndroidRuntime(10600):        at android.app.ActivityThread.access$2100(ActivityThread.java:145)
E/AndroidRuntime(10600):        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1421)
E/AndroidRuntime(10600):        at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(10600):        at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime(10600):        at android.app.ActivityThread.main(ActivityThread.java:5319)
E/AndroidRuntime(10600):        at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(10600):        at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime(10600):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1016)
E/AndroidRuntime(10600):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:811)
I/Process (10600): Sending signal. PID: 10600 SIG: 9
I/CrashMonitor(10917): CrashMonitorServiceBroadcastReceiver: Forwarding intent: android.intent.action.DROPBOX_ENTRY_ADDED tag: data_app_crash
I/CrashMonitor(10917): CrashMonitorService: Service started...
I/ActivityManager(  879): Process com.peppertech (pid 10600) has died
W/ActivityManager(  879): Service crashed 2 times, stopping: ServiceRecord{322842fe u0 com.peppertech/com.marianhello.bgloc.LocationService}
D/ForegroundUtils( 1655): Process died; UID 10243 PID 10600
D/ForegroundUtils( 1655): Foreground changed, PID: 10600 UID: 10243 foreground: false
D/ForegroundUtils( 1655): Foreground UID/PID combinations:
D/ForegroundUtils( 1655): UID: 10098 PID: 1798
I/CrashMonitor(10917): CrashMonitorService: action: android.intent.action.DROPBOX_ENTRY_ADDED
E/CrashMonitor(10917): DropBoxHandler: crashhandler store: 
E/CrashMonitor(10917): DropBoxHandler: crashhandler store: for
E/CrashMonitor(10917): DropBoxHandler: crashhandler store: for
E/CrashMonitor(10917): DropBoxHandler: crashhandler store: for
I/CrashMonitor(10917): CrashMonitorService: Service stopped...
mauron85 commented 6 years ago

Found java.lang.NoClassDefFoundError: com.marianhello.bgloc.ActivityRecognitionLocationProvider which is very strange. It will not compile without it.

mauron85 commented 6 years ago

Try to update your android dependencies. https://github.com/mauron85/react-native-background-geolocation#dependencies

mauron85 commented 6 years ago

And also if you include many libraries. Try https://developer.android.com/studio/build/multidex.html

hstemplewski commented 6 years ago

I found something, it start working when i switch to distance provider in config.

@mauron85 i use multidex, and i have all dependencies installed. If you will know why it not work on Activity provider, please tell me cause i dont have any idea.

And btw, please update lib, cause i have to add

compile 'com.android.support:support-v4:23+'
compile 'com.google.android.gms:play-services-location:9.4.0'

this 2 lines in node_modules/react-native-mauron85-background-geolocation/android/lib/build.gradle I have "react-native-mauron85-background-geolocation": "^0.4.0-alpha.6" version

mauron85 commented 6 years ago

Sorry. It must be specific to your device. I use ActivityProvider in Example App without any problem.

hstemplewski commented 6 years ago

Ok but it not works on real device and symulator too (I try it on more real devices). Ok, i will use another provider. 👍 thanks for quick reply and please if you find some time add this two lines in build.gradle file. I saw issue about it. https://github.com/mauron85/react-native-background-geolocation/issues/116

mauron85 commented 6 years ago

Then it could be problem with your android sdk dependencies.

mauron85 commented 6 years ago

Also ActivityProvider depends on Google Play Services. I expect you have them installed in your simulator and devices.

hstemplewski commented 6 years ago

Yes sure i have installed cause i use react-native-maps, and react-native-firebase. And i use multidex ect to have different versions.

dependencies {
    compile project(':react-native-vector-icons')
    compile project(':react-native-image-crop-picker')
    compile(project(':react-native-mauron85-background-geolocation')) {
        exclude group: 'com.google.android.gms', module: 'play-services-location'
    }
    compile 'com.android.support:multidex:1.0.1'
    compile(project(':react-native-maps')) {
        exclude group: 'com.google.android.gms', module: 'play-services-base'
        exclude group: 'com.google.android.gms', module: 'play-services-maps'
    }
    compile "com.google.android.gms:play-services-base:11.4.2"
    compile "com.google.android.gms:play-services-maps:11.4.2"
    compile(project(':react-native-firebase')) {
        transitive = false
    }
    compile "com.google.firebase:firebase-core:11.4.2"
    compile "com.google.firebase:firebase-firestore:11.4.2"
    compile "com.google.firebase:firebase-auth:11.4.2"
    compile "com.google.firebase:firebase-storage:11.4.2"
    compile "com.google.firebase:firebase-messaging:11.4.2"
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:23.0.1"
    compile "com.facebook.react:react-native:+"  // From node_modules
}
shaikhussian commented 6 years ago

@hstemplewski did you fix the above issue? I also getting same issue, can you please give me suggestions that how to fix it.

here is the error i am getting while build the app

screen shot 2017-11-21 at 11 41 44

here is my build.gradle

screen shot 2017-11-21 at 11 42 12

can you please give me suggestions that how can i fix this.

hstemplewski commented 6 years ago

check my dependencies two comments above, and do it just like me using:

compile(project(':react-native-mauron85-background-geolocation')) {
        exclude group: 'com.google.android.gms', module: 'play-services-location'
    }

and you should add multidex in build.gradle https://developer.android.com/studio/build/multidex.html

android {
    defaultConfig {
        ...
        minSdkVersion 21 
        targetSdkVersion 26
        multiDexEnabled true
    }
    ...
}

but when your app will crash on example try to use another provider. @shaikhussian

gigby commented 6 years ago

@mauron85 In "Compatibility" section there is requirement for android users:

If you are using react-native-maps or another lib that requires react-native-maps such as Exponent.js or airbnb's react-native-maps then aditionally to the instalation steps described here, you must also change node_modules...

This step is not necessary to install your library. This is typical problem and one is described and solved here - https://medium.com/@suchydan/how-to-solve-google-play-services-version-collision-in-gradle-dependencies-ef086ae5c75f

mauron85 commented 6 years ago

@gigby agree. That comment was written in time I was not aware of better solution. Example App should be updated. I would appreciate to create issue in example repo or even better PR.

mauron85 commented 6 years ago

Moving issue to https://github.com/mauron85/react-native-background-geolocation-example. Please continue discussion there.

mauron85 commented 6 years ago

Link to new issue https://github.com/mauron85/react-native-background-geolocation-example/issues/3