Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kotlin.UninitializedPropertyAccessException: lateinit property orders has not been initialized #24

Closed
alessandro-basso-pdl opened this issue Apr 17, 2024 · 4 comments
Assignees

Comments

@alessandro-basso-pdl
Copy link

Hello,
Using SDK version 2.9.2, we are seeing the following exception in our Crashlytics logs, caused by the lateinit property orders not initialized:

Fatal Exception: java.lang.RuntimeException
Unable to create service com.radiusnetworks.flybuy.sdk.pickup.service.LocationService: kotlin.UninitializedPropertyAccessException: lateinit property orders has not been initialized

Full stack trace:

Fatal Exception: java.lang.RuntimeException: Unable to create service com.radiusnetworks.flybuy.sdk.pickup.service.LocationService: kotlin.UninitializedPropertyAccessException: lateinit property orders has not been initialized
       at android.app.ActivityThread.handleCreateService(ActivityThread.java:5111)
       at android.app.ActivityThread.-$$Nest$mhandleCreateService()
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2506)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loopOnce(Looper.java:230)
       at android.os.Looper.loop(Looper.java:319)
       at android.app.ActivityThread.main(ActivityThread.java:8893)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:608)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)



Caused by kotlin.UninitializedPropertyAccessException
lateinit property orders has not been initialized

Full stack trace:

Caused by kotlin.UninitializedPropertyAccessException: lateinit property orders has not been initialized
at com.radiusnetworks.flybuy.sdk.FlyBuyCore.getOrders(FlyBuyCore.kt:1)
at com.radiusnetworks.flybuy.sdk.pickup.service.a.(BaseLocationService.kt:103)
at com.radiusnetworks.flybuy.sdk.pickup.service.LocationService.(LocationService.kt)
at java.lang.Class.newInstance(Class.java)
at android.app.AppComponentFactory.instantiateService(AppComponentFactory.java:129)
at androidx.core.app.CoreComponentFactory.instantiateService(CoreComponentFactory.java)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:5073)
at android.app.ActivityThread.-$$Nest$mhandleCreateService()
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2506)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:230)
at android.os.Looper.loop(Looper.java:319)
at android.app.ActivityThread.main(ActivityThread.java:8893)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:608)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)


In general, FlyBuy works fine within the app. The above issue is affecting a minority of uses in production. Steps to reproduce the issue are not known.
Please recommend which version of the SDK addresses the issue. Thanks!
@alessandro-basso-pdl alessandro-basso-pdl changed the title Unable to create service com.radiusnetworks.flybuy.sdk.pickup.service.LocationService: kotlin.UninitializedPropertyAccessException: lateinit property orders has not been initialized kotlin.UninitializedPropertyAccessException: lateinit property orders has not been initialized Apr 17, 2024
@botnerd botnerd self-assigned this Apr 17, 2024
@botnerd
Copy link
Member

botnerd commented Apr 17, 2024

Thank you for the detailed crash information. We have seen this type of crash when the app is not calling FlyBuyCore.configure(...) in Application.onCreate(...). FlyBuyCore.configure(...) makes sure those variables are initialized within the SDK before anything else uses them. Can you confirm that your app is initializing the Flybuy SDK in Application.onCreate()?

@alessandro-basso-pdl
Copy link
Author

alessandro-basso-pdl commented Apr 17, 2024

Yes, I confirm that FlyBuyCore.configure is called in Application > onCreate.

The code has been working ok till now. The only difference with respect to the past is that we are now targeting API level 34. Could that be having something to do with the issue?

Also, would upgrading the SDK to version 2.11.0 help resolving the issue?

@botnerd
Copy link
Member

botnerd commented Apr 18, 2024

That's helpful. If you are targeting API 34, you need to use at least v2.10.0 of the SDK (although we always recommend updating to the latest whenever possible). Note that there are a couple of breaking changes (although easy to upgrade) for gradle and java 8 time libraries. Instructions are provided at https://www.radiusnetworks.com/developers/flybuy/#/sdk-2.0/android-14. If you continue to see the problem after updating, please let us know.

@botnerd
Copy link
Member

botnerd commented Jun 3, 2024

Closing this issue as stale. If you continue to have issues, please open a new issue.

@botnerd botnerd closed this as completed Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants