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

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

Open
AngeloAvv opened this issue Jan 21, 2025 · 0 comments
Open

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

AngeloAvv opened this issue Jan 21, 2025 · 0 comments

Comments

@AngeloAvv
Copy link

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!!

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

1 participant