google-ar / arcore-android-sdk

ARCore SDK for Android Studio
https://developers.google.com/ar
Other
4.98k stars 1.22k forks source link

Session recreation throws exception #637

Closed Chuckytuh closed 3 years ago

Chuckytuh commented 6 years ago

In this particular application user's can come return to the activity that has the AR Scene multiple times. However, by the third time that a new Session() is created, the following exception is thrown:

E/blg: *~*~*~ Channel {0} was not shutdown properly!!! ~*~*~*
        Make sure to call shutdown()/shutdownNow() and wait until awaitTermination() returns true.
    java.lang.RuntimeException: ManagedChannel allocation site
        at blh.<init>(PG:4)
        at blg.<init>(PG:4)
        at blg.<init>(PG:1)
        at beh.a(PG:55)
        at com.google.ar.persistence.AnchorServiceClientFactory.create(PG:17)
        at com.google.ar.core.Session.nativeCreateSession(Native Method)
        at com.google.ar.core.Session.<init>(Unknown Source:22)
        at com.myapp.ar.picker.ArUtils.createArSession(ArUtils.java:65)
        at com.myapp.ar.picker.ARPackagePickerActivity.onResume(ARPackagePickerActivity.java:249)
        at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1412)
        at android.app.Activity.performResume(Activity.java:7292)
        at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3776)
        at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3816)
        at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:51)
        at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:145)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:193)
        at android.app.ActivityThread.main(ActivityThread.java:6669)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858

The sceneview is being paused and destroyed pretty much like the sample showcases and it only happens from the third time on 🤔

inio commented 5 years ago

I've asked our Cloud Anchors group to respond to this as it seems to be within the cloud anchor system.

jrullman commented 5 years ago

We have identified the cause of the crash and will have a fix in an upcoming release.

inio commented 5 years ago

The fix for this didn't make the cut for 1.6 but will be in our next release.

bigant88 commented 5 years ago

I got the same exception. Please fix this early.

``

PauGuillamon commented 5 years ago

I am also seeing this issue with a Pixel 3 XL, ARCore version 1.7.190128146

Even though my app is not crashing, I see the same logs in logcat.

devbridie commented 3 years ago

As a part of ongoing efforts to maintain ARCore repositories, I’m closing this issue as stale since it hasn’t had activity in more than 6 months. If this issue is still relevant, please feel free to file a new bug using the latest version of the SDK.