google-ar / arcore-android-sdk

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

Fatal exception on Session.createAnchor #1607

Open havel-sophis opened 10 months ago

havel-sophis commented 10 months ago

SPECIFIC ISSUE ENCOUNTERED

When I call this:

if (camera.getTrackingState() == TrackingState.TRACKING) {
    anchor = session.createAnchor(new Pose(pos, rotation));
}

my Activity closes with FATAL EXCEPTION: GLThread 1617536. It happens when I do cover camera. Im probably doing something stupid but as it crashes directly in AR core I have no idea what ... hopefully this stack trace will help:

FATAL EXCEPTION: GLThread 1617536
Process: REDACTED, PID: 16011
    com.google.ar.core.exceptions.FatalException
    at java.lang.reflect.Constructor.newInstance0(Native Method)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
    at com.google.ar.core.Session.throwExceptionFromArStatus(Session.java:14)
    at com.google.ar.core.Session.nativeCreateAnchor(Native Method)
    at com.google.ar.core.Session.createAnchor(Session.java:1) ...

VERSIONS USED