radar-sdk-android icon indicating copy to clipboard operation
radar-sdk-android copied to clipboard

Updating to some of the Play Services libraries is causing a crash

Open IDMCI opened this issue 3 years ago • 5 comments

Summary

Updates to play-services-ads-identifier and play-services-location is causing a crash in RadarGoogleLocationClient when our app starts up. There are some deprecated methods and when updating those Android libraries in our project, it's causing a crash as soon as the Radar library where FusedLocationProviderClient is being instantiated in the RadarGoogleLocationClient.

Steps to reproduce

Update com.google.android.gms:play-services-ads-identifier to 21.3.0 and com.google.android.gms:play-services-location to 21.0.0 and build the project.

FATAL EXCEPTION: main
java.lang.InstantiationError:com.google.android.gms.location.FusedLocationProviderClient
at io.radar.sdk.RadarGoogleLocationClient.<init>(RadarGoogleLocationClient.kt:24)
at io.radar.sk. RadarLocationManager.<init>(RadarLocationManager.kt:32)
at io.radar.sdk.RadarLocationManager.<init>(RadarLocationManager.kt:22)
at io.radar.sdk.Radar.initialize(Radar.kt:440)
at io.radar.sdk.Radar.initialize$default(Radar.kt:401)

OS version

Android 23 and above

SDK version

Radar SDK version: 3.5.4

IDMCI avatar Oct 18 '22 15:10 IDMCI

Hey @IDMCI, sorry about this. We're happy to jump on this ASAP. Mind sharing a little bit more info? More detailed stack trace, # and breakdown of users affected, etc. Happy to pick up the conversation on Slack (shared channel) or email ([email protected] and [email protected]) if preferred.

/cc @brettguenther @tjulien

nickpatrick avatar Oct 18 '22 19:10 nickpatrick

Looks like this might be the culprit: https://developers.google.com/android/guides/releases#october_13_2022

@IDMCI Can you pin com.google.android.gms:play-services-location to 18.0.0 for now? https://github.com/radarlabs/radar-sdk-android/blob/develop/sdk/build.gradle#L70

We'll look into supporting the latest version and get back to you ASAP with an ETA.

nickpatrick avatar Oct 18 '22 19:10 nickpatrick

@nickpatrick Thank you so much for the speedy response!

Funny enough, we've already moved com.google.android.gms:play-services-location to '20.0.0' and luckily it hasn't been causing any issues until version 21.0.0. But yeah, we ran into the same issue with how we were instantiating LocationRequest was causing a breakage elsewhere in our app.

We can leave play-services-location at 20.0.0 for the time being but definitely let me know when you're able to get a time table around supporting the latest. Thanks!

IDMCI avatar Oct 18 '22 23:10 IDMCI

Same Problem, tried updating to play-services-location from 20.0.0 to 21.0.0 and app wouldn't start on Pixel 3a (due to radar crash). Will wait for compatible version of radar SDK before we update play-services-location

jt-gilkeson avatar Oct 25 '22 02:10 jt-gilkeson

We'll have a fix ready by the end of the week. Thanks for your patience!

nickpatrick avatar Oct 25 '22 02:10 nickpatrick

Fix is in #243. We'll do some testing and release in the next day or two.

nickpatrick avatar Oct 31 '22 10:10 nickpatrick

@nickpatrick With Radar3.5.7if I try to use play-services-location:21.0.1 I'm now getting:

   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/...
       	at io.radar.sdk.RadarGoogleLocationClient.removeLocationUpdates(RadarGoogleLocationClient.kt:60)
     	at io.radar.sdk.RadarLocationManager.stopLocationUpdates(RadarLocationManager.kt:134)
   	at io.radar.sdk.RadarLocationManager.updateTracking$sdk_release(RadarLocationManager.kt:228)
  	at io.radar.sdk.RadarLocationManager.updateTracking$sdk_release$default(RadarLocationManager.kt:166)
       	at io.radar.sdk.Radar.initialize(Radar.kt:441)
    	at io.radar.sdk.Radar.initialize$default(Radar.kt:401)
   	at io.radar.sdk.Radar.initialize(Radar.kt:387)

jt-gilkeson avatar Nov 24 '22 09:11 jt-gilkeson

Hey @jt-gilkeson, @tjulien is working through an upgrade to 21.0.1 right now.

nickpatrick avatar Nov 26 '22 01:11 nickpatrick

@nickpatrick I saw the same crashes on play-services-location:21.0.0 (I had tried both 21.0.0 and 21.0.1)
The IncompatibleClassChangeError seems be for io.radar.sdk.RadarGoogleLocationClient.removeLocationUpdate on 3.5.7 The InstantiationError seems to be for io.radar.sdk.RadarGoogleLocationClient. on 3.5.6

jt-gilkeson avatar Nov 26 '22 01:11 jt-gilkeson

Thanks for flagging, @jt-gilkeson. We'll make sure this and other breaking changes are addressed before we upgrade to 21.0.1 in the next release. @tjulien

nickpatrick avatar Nov 26 '22 02:11 nickpatrick

@nickpatrick Still getting a crash in3.5.9with21.0.1

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 ...dex)
  at io.radar.sdk.RadarGoogleLocationClient.removeLocationUpdates(RadarGoogleLocationClient.kt:60)
  at io.radar.sdk.RadarLocationManager.stopLocationUpdates(RadarLocationManager.kt:134)
  at io.radar.sdk.RadarLocationManager.updateTracking$sdk_release(RadarLocationManager.kt:227)
  at io.radar.sdk.RadarLocationManager.updateTracking$sdk_release$default(RadarLocationManager.kt:166)
  at io.radar.sdk.Radar.initialize(Radar.kt:441)
  at io.radar.sdk.Radar.initialize$default(Radar.kt:401)
  at io.radar.sdk.Radar.initialize(Radar.kt:387)

jt-gilkeson avatar Dec 13 '22 01:12 jt-gilkeson

Hi @jt-gilkeson we've been testing version 21.0.1 internally but are not quite ready to release it. As a workaround, if you are able to exclude play-services-location:18.0.0 in your gradle file, the radar code should be forward compatible with 21.0.1.

tjulien avatar Dec 13 '22 23:12 tjulien

Hi! Is there any update on this issue? We tested updating radar to latest version of 3.6.0 and it's still crashing with com.google.android.gms:play-services-location version 21.0.1.

IDMCI avatar Mar 14 '23 19:03 IDMCI

Hi @IDMCI , we just published 3.7.1-beta.1 which upgrades com.google.android.gms:play-services-location to 21.0.1. We'll be testing this beta over the next 1-2 weeks before creating the final release. Feel free to use this beta to do internal testing ahead of the final release if that is helpful.

tjulien avatar Mar 15 '23 20:03 tjulien

Hi @tjulien, I noticed that you released version 3.7.1 but it seems that it doesn't include the upgrades of com.google.android.gms:play-services-location.

Do you have any workaround to solve this issue? or is it better to wait for 3.7.2?

edwinperazadsg avatar Mar 24 '23 17:03 edwinperazadsg

Hi @edwinperazadsg, I work with Tim at Radar.

We had some changes that we needed to get out in an official release quickly. We're continuing to test the upgrade and figure out solutions for projects with conflicting play-services-location dependencies.

Feel free to test and build with 3.7.1-beta.1. We'll respond back here in thread whenever we make an official release with the upgrade.

lmeier avatar Mar 24 '23 17:03 lmeier

Hello! I'm using version 3.8.1 and it is working now. Thanks @lmeier and @tjulien

edwinperazadsg avatar Apr 06 '23 18:04 edwinperazadsg

@edwinperazadsg That's great to hear. We upgraded play-services-location to version 21.0.1 in Radar SDK 3.8.0, so marking this as fixed.

tjulien avatar Apr 07 '23 13:04 tjulien