Skip to content

java.lang.IllegalStateException - Places must be initialized. #109

@AngeloAvv

Description

@AngeloAvv

Hello! First of all, thanks for this amazing library!

I'm receiving a strange crash into my Crashlytics account which sounds definitely not related with the places behavior itself. Let me attach the stack trace.

       Caused by java.lang.IllegalStateException: Places must be initialized.
       at com.google.android.libraries.places.internal.zzjp.zzk(com.google.android.libraries.places:places@@3.2.0:7)
       at com.google.android.libraries.places.widget.AutocompleteActivity.onCreate(com.google.android.libraries.places:places@@3.2.0:6)
       at android.app.Activity.performCreate(Activity.java:8305)
       at android.app.Activity.performCreate(Activity.java:8284)
       at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1417)
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3626)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3782)
       at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
       at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
       at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2307)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loopOnce(Looper.java:201)
       at android.os.Looper.loop(Looper.java:288)
       at android.app.ActivityThread.main(ActivityThread.java:7872)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

By taking a look at the app logs, the user didn't even enter the section where the flutter_google_places_sdk takes place, but it all happened while using the app normally.

Personally, I never experienced something like that during these days developing this feature with flutter_google_places_sdk, that's why I'm here asking for help.

As far as I can tell, looking at the app logs, the crash happened after the app changed state to AppLifecycleState.inactive, then AppLifecycleState.paused and finally AppLifecycleState.hidden, so I'm assuming the onCreate method might have been called twice somewhere and destroyed the previously Places instance.

Thanks for your help!!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions