The most sophisticated background location-tracking & geofencing module with battery-conscious motion-detection intelligence for iOS and Android.
97
stars
16
forks
source link
java.lang.IncompatibleClassChangeError: Found interface com.google.android.gms.location.FusedLocationProviderClient, but class was expected #180
Closed
GuidoABeltrame closed 1 year ago
Your Environment
Plugin version: "cordova-background-geolocation-lt": "^4.12.0" / "cordova-plugin-background-fetch": "^7.1.2"
Platform: iOS or Android
Device OS version: any version
Device manufacturer / model:
XCode version: 14.13.1
Capacitor info (
npx cap doctor
)Latest Dependencies:
Installed Dependencies:
Plugin config provided to
#ready
:Expected Behavior
I expect the plugin starts correctly
Actual Behavior
When the method "start()" is called, the app crashes and stop.
Steps to Reproduce
Context
The company is Movertis. We have a licence. The app is running in virtual device in android studio.
My AndroidManifest.xml
My build.gradle
My variables.gradle
My method start()
Debug logs
Logs
``` To native (Capacitor plugin): callbackId: 98335162, pluginId: Preferences, methodName: get 2023-07-11 09:32:12.313 8925-8925 Capacitor com.movertis.assistantv2 V callback: 98335162, pluginId: Preferences, methodName: get, methodData: {"key":"jwt"} 2023-07-11 09:32:12.352 8925-10017 EGL_emulation com.movertis.assistantv2 D app_time_stats: avg=84.53ms min=4.03ms max=4778.52ms count=60 2023-07-11 09:32:13.361 8925-10017 EGL_emulation com.movertis.assistantv2 D app_time_stats: avg=5.35ms min=3.73ms max=10.57ms count=61 2023-07-11 09:32:14.362 8925-10017 EGL_emulation com.movertis.assistantv2 D app_time_stats: avg=4.82ms min=3.89ms max=10.81ms count=60 2023-07-11 09:32:14.869 8925-8925 Capacitor/Plugin com.movertis.assistantv2 V To native (Capacitor plugin): callbackId: 98335163, pluginId: Preferences, methodName: get 2023-07-11 09:32:14.869 8925-8925 Capacitor com.movertis.assistantv2 V callback: 98335163, pluginId: Preferences, methodName: get, methodData: {"key":"jwt"} 2023-07-11 09:32:14.876 8925-8925 Capacitor/Plugin com.movertis.assistantv2 V To native (Cordova plugin): callbackId: BackgroundGeolocation1242818410, service: BackgroundGeolocation, action: addLocationListener, actionArgs: [] 2023-07-11 09:32:14.877 8925-8925 Capacitor/Plugin com.movertis.assistantv2 V To native (Cordova plugin): callbackId: BackgroundGeolocation1242818411, service: BackgroundGeolocation, action: addMotionChangeListener, actionArgs: [] 2023-07-11 09:32:14.878 8925-8925 Capacitor/Plugin com.movertis.assistantv2 V To native (Cordova plugin): callbackId: BackgroundGeolocation1242818412, service: BackgroundGeolocation, action: addHttpListener, actionArgs: [] 2023-07-11 09:32:14.878 8925-8925 Capacitor/Plugin com.movertis.assistantv2 V To native (Cordova plugin): callbackId: BackgroundGeolocation1242818413, service: BackgroundGeolocation, action: addProviderChangeListener, actionArgs: [] 2023-07-11 09:32:14.879 8925-8925 Capacitor/Plugin com.movertis.assistantv2 V To native (Cordova plugin): callbackId: BackgroundGeolocation1242818414, service: BackgroundGeolocation, action: ready, actionArgs: [{"reset":true,"debug":false,"logLevel":5,"distanceFilter":10,"url":"https:\/\/assistant-mobile-gateway.hellomovertis.com\/gps\/add","extras":{"phone":"20030040011","jwt":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjoiZjMwMzBlZTMwZDVmNzg4NThhYmEzY2QyZDMyZDdlNTk4ZWE3NmQwMzRiNjY2MTBlZDM5ODhkZDAwNTY1Y2ViMHdOeGRLT0Fjd3lwM3Y2N0JtbkxLSEJIU2oweElnM0k1MVYxWXMyTDMwVTd4ekZpb3dkaHBGS3pUaXE3OVF6RVE4VHBncThJYzBGMVM4VCtNMzhrYnJBMlRLeVpUcVVtQnh5cDhtcFBDV0VNVjh5ZXJnSVZEcFNUOHlCQjM1cmxYaTJHNTRwVTdmWkRtWjNzbEpnYnFvclBieXJ0K0xuSTNkRk5xMVVpbGZzQmFRaENWNFU5TFBMWEZEVTFsWFM1VVhTSzI1UGkvdWk1V1VXbmNlNUVqM016N0duMmJQYUJocXFxcHduRy9pVW9GY05Kc2lMY0FJVVF0azFNYitrbDk2cFcyZFlXMVNmampDTVZtdEJSdlhpQUVJNHJ5LzZ0TXEzSm9vVFp1Nm9Uc2d5Q2RJTzZJbjkybExjR2lwL1l4bXNJSDFna1lxQ3AvM2FFdk54UFZudz09IiwiaWF0IjoxNjg5MDc4Mzg2fQ.FYfRpk12aVI5MJzIT1Uuhv3RsRQBujJVOhM04k88WWc"},"autoSync":true,"stopOnTerminate":false,"startOnBoot":true}] 2023-07-11 09:32:14.883 8925-10069 TSLocationManager com.movertis.assistantv2 D $ addLocationListener() 2023-07-11 09:32:14.883 8925-10069 TSLocationManager com.movertis.assistantv2 D $ addMotionChangeListener() 2023-07-11 09:32:14.883 8925-10069 TSLocationManager com.movertis.assistantv2 D $ addHttpListener() 2023-07-11 09:32:14.883 8925-10069 TSLocationManager com.movertis.assistantv2 D $ addProviderChangeListener() 2023-07-11 09:32:14.883 8925-10069 TSLocationManager com.movertis.assistantv2 D $ ready() 2023-07-11 09:32:14.888 8925-10069 TSLocationManager com.movertis.assistantv2 D [c.t.l.adapter.TSConfig d] ℹ️ Persist config, dirty: [extras, headers, headlessJobService, logLevel, params, schedule, startOnBoot, stopOnTerminate, url] 2023-07-11 09:32:14.898 8925-10069 Settings com.movertis.assistantv2 W Setting airplane_mode_on has moved from android.provider.Settings.System to android.provider.Settings.Global, returning read-only value. 2023-07-11 09:32:14.900 8925-8925 TSLocationManager com.movertis.assistantv2 I [c.t.l.http.HttpService flush] ╔═════════════════════════════════════════════ ║ HTTP Service (count: 0) ╠═════════════════════════════════════════════ 2023-07-11 09:32:14.901 8925-10069 TSLocationManager com.movertis.assistantv2 D [c.t.locationmanager.util.c g] ℹ️ LocationAuthorization: Permission granted 2023-07-11 09:32:14.903 8925-10074 TSLocationManager com.movertis.assistantv2 I - Enable: true → true, trackingMode: 1 2023-07-11 09:32:14.905 8925-10069 Settings com.movertis.assistantv2 W Setting airplane_mode_on has moved from android.provider.Settings.System to android.provider.Settings.Global, returning read-only value. 2023-07-11 09:32:14.913 8925-10074 TSLocationManager com.movertis.assistantv2 D [c.t.l.http.HttpService startMonitoringConnectivityChanges] 🎾 Start monitoring connectivity changes 2023-07-11 09:32:14.914 8925-8925 Capacitor/Console com.movertis.assistantv2 I File: https://localhost/main.035312081ee51a9f.js - Line 1 - Msg: [providerchange] - true 3 true 2023-07-11 09:32:14.917 8925-10074 TSLocationManager com.movertis.assistantv2 D [c.t.l.device.DeviceSettings startMonitoringPowerSaveChanges] 🎾 Start monitoring powersave changes 2023-07-11 09:32:14.922 8925-10074 TSLocationManager com.movertis.assistantv2 D [c.t.locationmanager.util.c h] ℹ️ LocationAuthorization: Permission granted 2023-07-11 09:32:14.923 8925-10074 TSLocationManager com.movertis.assistantv2 I [c.t.l.service.HeartbeatService stop] 🔴 Stop heartbeat 2023-07-11 09:32:14.944 8925-8925 Capacitor/Console com.movertis.assistantv2 I File: https://localhost/main.035312081ee51a9f.js - Line 1 - Msg: [ready] BackgroundGeolocation is ready to use true 2023-07-11 09:32:14.948 8925-8925 TSLocationManager com.movertis.assistantv2 D [c.t.l.service.AbstractService start] 🎾 LocationRequestService [eventCount: 1] 2023-07-11 09:32:14.950 8925-10074 TSLocationManager com.movertis.assistantv2 I [c.t.l.l.SingleLocationRequest startUpdatingLocation] 🔵 [SingleLocationRequest start, action: 1, requestId: 1] 2023-07-11 09:32:14.968 8925-10074 AndroidRuntime com.movertis.assistantv2 E FATAL EXCEPTION: pool-9-thread-5 Process: com.movertis.assistantv2, PID: 8925 java.lang.IncompatibleClassChangeError: Found interface com.google.android.gms.location.FusedLocationProviderClient, but class was expected (declaration of 'com.google.android.gms.location.FusedLocationProviderClient' appears in /data/app/~~USk7l2XiDsFweh4rbDPcyA==/com.movertis.assistantv2-6SHckY4s15BfBybdkCeo4Q==/base.apk) at com.transistorsoft.xms.g.location.FusedLocationProviderClient.requestLocationUpdates(Unknown Source:70) at com.transistorsoft.locationmanager.location.SingleLocationRequest.startUpdatingLocation(Unknown Source:131) at com.transistorsoft.locationmanager.service.LocationRequestService.handleStartAction(Unknown Source:78) at com.transistorsoft.locationmanager.service.LocationRequestService.access$200(Unknown Source:0) at com.transistorsoft.locationmanager.service.LocationRequestService$a.run(Unknown Source:62) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) at java.lang.Thread.run(Thread.java:1012) 2023-07-11 09:32:14.974 8925-10074 TSLocationManager com.movertis.assistantv2 E [c.t.l.a.BackgroundGeolocation$w0 uncaughtException] ‼️ Uncaught Exception: Found interface com.google.android.gms.location.FusedLocationProviderClient, but class was expected (declaration of 'com.google.android.gms.location.FusedLocationProviderClient' appears in /data/app/~~USk7l2XiDsFweh4rbDPcyA==/com.movertis.assistantv2-6SHckY4s15BfBybdkCeo4Q==/base.apk) {"activityRecognitionInterval":10000,"allowIdenticalLocations":false,"authorization":{},"autoSync":true,"autoSyncThreshold":0,"backgroundPermissionRationale":{"title":"Allow {applicationName} to access this device's location even when closed or not in use?","message":"[CHANGEME] This app collects location data for FEATURE X and FEATURE Y.","positiveAction":"Change to \"{backgroundPermissionOptionLabel}\"","negativeAction":""},"batchSync":false,"configUrl":"","debug":false,"deferTime":0,"desiredAccuracy":0,"desiredOdometerAccuracy":100,"disableAutoSyncOnCellular":false,"disableElasticity":false,"disableLocationAuthorizationAlert":false,"disableMotionActivityUpdates":false,"disableProviderChangeRecord":false,"disableStopDetection":false,"distanceFilter":10,"elasticityMultiplier":1,"enableHeadless":false,"enableTimestampMeta":false,"extras":{"phone":"20030040011","jwt":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjoiZjMwMzBlZTMwZDVmNzg4NThhYmEzY2QyZDMyZDdlNTk4ZWE3NmQwMzRiNjY2MTBlZDM5ODhkZDAwNTY1Y2ViMHdOeGRLT0Fjd3lwM3Y2N0JtbkxLSEJIU2oweElnM0k1MVYxWXMyTDMwVTd4ekZpb3dkaHBGS3pUaXE3OVF6RVE4VHBncThJYzBGMVM4VCtNMzhrYnJBMlRLeVpUcVVtQnh5cDhtcFBDV0VNVjh5ZXJnSVZEcFNUOHlCQjM1cmxYaTJHNTRwVTdmWkRtWjNzbEpnYnFvclBieXJ0K0xuSTNkRk5xMVVpbGZzQmFRaENWNFU5TFBMWEZEVTFsWFM1VVhTSzI1UGkvdWk1V1VXbmNlNUVqM016N0duMmJQYUJocXFxcHduRy9pVW9GY05Kc2lMY0FJVVF0azFNYitrbDk2cFcyZFlXMVNmampDTVZtdEJSdlhpQUVJNHJ5LzZ0TXEzSm9vVFp1Nm9Uc2d5Q2RJTzZJbjkybExjR2lwL1l4bXNJSDFna1lxQ3AvM2FFdk54UFZudz09IiwiaWF0IjoxNjg5MDc4Mzg2fQ.FYfRpk12aVI5MJzIT1Uuhv3RsRQBujJVOhM04k88WWc"},"fastestLocationUpdateInterval":-1,"foregroundService":true,"geofenceInitialTriggerEntry":true,"geofenceModeHighAccuracy":false,"geofenceProximityRadius":1000,"geofenceTemplate":"","headers":{},"headlessJobService":"com.transistorsoft.cordova.bggeo.BackgroundGeolocationHeadlessTask","heartbeatInterval":-1,"httpRootProperty":"location","httpTimeout":60000,"isMoving":false,"locationAuthorizationRequest":"Always","locationTemplate":"","locationTimeout":60,"locationUpdateInterval":1000,"locationsOrderDirection":"ASC","logLevel":5,"logMaxDays":3,"maxBatchSize":-1,"maxDaysToPersist":1,"maxRecordsToPersist":-1,"method":"POST","minimumActivityRecognitionConfidence":75,"motionTriggerDelay":0,"notification":{"layout":"","title":"","text":"Location Service activated","color":"","channelName":"TSLocationManager","channelId":"","smallIcon":"","largeIcon":"","priority":0,"sticky":false,"strings":{},"actions":[]},"params":{},"persist":true,"persistMode":2,"schedule":[],"scheduleUseAlarmManager":false,"speedJumpFilter":300,"startOnBoot":true,"stationaryRadius":25,"stopAfterElapsedMinutes":0,"stopOnStationary":false,"stopOnTerminate":false,"stopTimeout":5,"triggerActivities":"in_vehicle, on_bicycle, on_foot, running, walking","url":"https:\/\/assistant-mobile-gateway.hellomovertis.com\/gps\/add","useSignificantChangesOnly":false,"enabled":true,"schedulerEnabled":false,"trackingMode":1,"odometer":0,"isFirstBoot":false,"didLaunchInBackground":false,"didDeviceReboot":false} java.lang.IncompatibleClassChangeError: Found interface com.google.android.gms.location.FusedLocationProviderClient, but class was expected (declaration of 'com.google.android.gms.location.FusedLocationProviderClient' appears in /data/app/~~USk7l2XiDsFweh4rbDPcyA==/com.movertis.assistantv2-6SHckY4s15BfBybdkCeo4Q==/base.apk) at com.transistorsoft.xms.g.location.FusedLocationProviderClient.requestLocationUpdates(Unknown Source:70) at com.transistorsoft.locationmanager.location.SingleLocationRequest.startUpdatingLocation(Unknown Source:131) 2023-07-11 09:32:14.974 8925-10074 TSLocationManager com.movertis.assistantv2 E at com.transistorsoft.locationmanager.service.LocationRequestService.handleStartAction(Unknown Source:78) at com.transistorsoft.locationmanager.service.LocationRequestService.access$200(Unknown Source:0) at com.transistorsoft.locationmanager.service.LocationRequestService$a.run(Unknown Source:62) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) at java.lang.Thread.run(Thread.java:1012) 2023-07-11 09:32:15.003 8925-8925 Capacitor/AppPlugin com.movertis.assistantv2 V Notifying listeners for event pause 2023-07-11 09:32:15.003 8925-8925 Capacitor/AppPlugin com.movertis.assistantv2 D No listeners found for event pause 2023-07-11 09:32:15.004 8925-8925 Capacitor com.movertis.assistantv2 D App paused 2023-07-11 09:32:15.153 8925-8925 Capacitor/AppPlugin com.movertis.assistantv2 D Firing change: false 2023-07-11 09:32:15.153 8925-8925 Capacitor/AppPlugin com.movertis.assistantv2 V Notifying listeners for event appStateChange 2023-07-11 09:32:15.154 8925-8925 Capacitor/AppPlugin com.movertis.assistantv2 D No listeners found for event appStateChange 2023-07-11 09:32:15.160 8925-8925 TSLocationManager com.movertis.assistantv2 I [c.t.l.s.TSScheduleManager oneShot] ⏰ Scheduled OneShot: TERMINATE_EVENT in 10000ms (jobID: -1708771588) 2023-07-11 09:32:15.166 8925-8925 Compatibil...geReporter com.movertis.assistantv2 D Compat change id reported: 194532703; UID 10157; state: ENABLED 2023-07-11 09:32:15.172 8925-8925 Capacitor com.movertis.assistantv2 D App stopped 2023-07-11 09:32:15.174 8925-8925 TSLocationManager com.movertis.assistantv2 I CDVBackgroundGeolocation#onDestoy 2023-07-11 09:32:15.176 8925-8925 TSLocationManager com.movertis.assistantv2 I [c.t.l.s.TSScheduleManager cancelOneShot] ⏰ Cancel OneShot: TERMINATE_EVENT 2023-07-11 09:32:15.184 8925-8925 TSLocationManager com.movertis.assistantv2 D [c.t.l.l.LifecycleManager a] ╔═════════════════════════════════════════════ ║ ☯️ HeadlessMode? true ╠═════════════════════════════════════════════ 2023-07-11 09:32:15.187 8925-8925 TSLocationManager com.movertis.assistantv2 D [c.t.l.a.BackgroundGeolocation b] 🔴 Cleared callbacks 2023-07-11 09:32:15.187 8925-8925 Capacitor com.movertis.assistantv2 D App destroyed 2023-07-11 09:32:15.189 8925-10304 TSLocationManager com.movertis.assistantv2 I [c.t.l.a.BackgroundGeolocation$l0 run] ╔═════════════════════════════════════════════ ║ MainActivity was destroyed ╠═════════════════════════════════════════════ ╟─ stopOnTerminate: false ╟─ enabled: true ---------------------------- PROCESS ENDED (10032) for package com.movertis.assistantv2 ---------------------------- 2023-07-11 09:32:15.703 8925-8925 TSLocationManager com.movertis.assistantv2 D [c.t.l.l.LifecycleManager onPause] ☯️ onPause 2023-07-11 09:32:15.704 8925-8925 TSLocationManager com.movertis.assistantv2 D [c.t.l.l.LifecycleManager onStop] ☯️ onStop 2023-07-11 09:34:18.397 8925-8966 Settings com.movertis.assistantv2 W Setting airplane_mode_on has moved from android.provider.Settings.System to android.provider.Settings.Global, returning read-only value. 2023-07-11 09:34:18.400 8925-8966 TSLocationManager com.movertis.assistantv2 D [c.t.l.http.HttpService a] ╔═════════════════════════════════════════════ ║ 📶 Connectivity change: connected? true ╠═════════════════════════════════════════════ 2023-07-11 09:34:19.412 8925-11526 TSLocationManager com.movertis.assistantv2 I [c.t.l.http.HttpService flush] ╔═════════════════════════════════════════════ ║ HTTP Service (count: 0) ╠═════════════════════════════════════════════ 2023-07-11 09:34:58.416 8925-8966 Settings com.movertis.assistantv2 W Setting airplane_mode_on has moved from android.provider.Settings.System to android.provider.Settings.Global, returning read-only value. ---------------------------- PROCESS ENDED (8925) for package com.movertis.assistantv2 ---------------------------- ```