pusher / push-notifications-android

Android SDK for Pusher Beams
https://www.pusher.com/beams
MIT License
22 stars 22 forks source link

KotlinReflectionNotSupportedError on app restart #125

Closed mbakerinfo closed 2 years ago

mbakerinfo commented 3 years ago

When an app including this library is restarted while it is running the app crashes from a "KotlinReflectionNotSupportedError"

This can be recreated using Android Studio 2021.1 canary 10 with a new fragment/viewmodel project, downgrading to android API 30 to avoid Issue #123.

Using com.google.gms:google-services:4.3.10 com.google.firebase:firebase-messaging:22.0.0 com.google.firebase:firebase-iid:21.1.0 com.pusher:push-notifications-android:1.7.0

Adding in onCreate : PushNotifications.start(applicationContext, "YOUR_INSTANCE_ID") PushNotifications.addDeviceInterest("hello")

(and doing all the other normal steps to add pusher to an app)

Hitting run app twice in android studio will recreate the crash.

benjamin-tang-pusher commented 3 years ago

Thanks for this, I also get the same in my project. Will try and figure out whats going on.

benjamin-tang-pusher commented 2 years ago

This was fixed on the newer version of Android Studio.