Purchasely / Purchasely-Android

Purchasely SDK for Android
Other
16 stars 2 forks source link

[PLYManager.setContext] kotlin.UninitializedPropertyAccessException - lateinit property context has not been initialized #8

Closed hatem-72 closed 10 months ago

hatem-72 commented 1 year ago

Hi, I'm integrating Purchasely in my react-native app. Since incorporating the Purchasely SDK, Crashlytics has reported this specific crash hundreds of times. I'm uncertain if this is due to an issue in my implementation or if it's a potential bug in the react-native library or the Android SDK.

Fatal Exception: kotlin.UninitializedPropertyAccessException: lateinit property context has not been initialized
       at io.purchasely.managers.PLYManager.setContext(PLYManager.kt:35)
       at io.purchasely.managers.PLYManager.getContext(PLYManager.kt:35)
       at io.purchasely.managers.PLYManager$storage$2.invoke(PLYManager.kt:37)
       at io.purchasely.managers.PLYManager$storage$2.invoke(PLYManager.kt:37)
       at io.purchasely.managers.PLYManager$storage$2.invoke(PLYManager.kt:37)
       at io.purchasely.managers.PLYManager$storage$2.invoke(PLYManager.kt:37)
       at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
       at io.purchasely.managers.PLYManager.<clinit>(PLYManager.kt:37)
       at io.purchasely.managers.PLYManager.getStorage(PLYManager.kt:37)
       at io.purchasely.managers.PLYManager.close(PLYManager.kt:178)
       at io.purchasely.ext.Purchasely.close(Purchasely.kt:224)
       at com.reactnativepurchasely.PurchaselyModule.close(PurchaselyModule.kt:167)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
       at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:188)
       at com.facebook.jni.NativeRunnable.run(NativeRunnable.java)
       at android.os.Handler.handleCallback(Handler.java:809)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
       at android.os.Looper.loop(Looper.java:166)
       at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:228)
       at java.lang.Thread.run(Thread.java:784)