google-ar / arcore-android-sdk

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

FatalException in onResume #261

Closed StevenOttoG closed 3 years ago

StevenOttoG commented 6 years ago

We get this exception sometimes in production on Samsung S8+ and Samsung Note8 devices. I think it should be handled by ARCore or this exception should be added to the docs.

Fatal Exception: java.lang.RuntimeException: Unable to resume activity {ArActivity}: com.google.ar.core.exceptions.FatalException
       at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3788)
       at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3828)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1746)
       at android.os.Handler.dispatchMessage(Handler.java:105)
       at android.os.Looper.loop(Looper.java:164)
       at android.app.ActivityThread.main(ActivityThread.java:6938)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)

Caused by com.google.ar.core.exceptions.FatalException
       at com.google.ar.core.Session.throwExceptionFromArStatus(SourceFile:334)
       at com.google.ar.core.Session.nativeResume(SourceFile)
       at com.google.ar.core.Session.resume(SourceFile:165)
       at ArActivity.onResume
       at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1361)
       at android.app.Activity.performResume(Activity.java:7344)
       at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3763)
       at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3828)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1746)
       at android.os.Handler.dispatchMessage(Handler.java:105)
       at android.os.Looper.loop(Looper.java:164)
       at android.app.ActivityThread.main(ActivityThread.java:6938)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
inio commented 6 years ago

There are cases where we're unable to reopen the camera, and don't get much in the way of a reason. ~In the next version, this exception will become a checked CameraNotAvailableException, but still happen.~

inio commented 6 years ago

We shouldn't be throwing FatalException, so that's a bug. However, this likely would become a CameraNotAvailableException.

avirodov commented 6 years ago

Hello, thank you for the report. Can you please attach a more complete log if one is available? In particular the ~100 or so lines above the Fatal Exception, but if you have a complete logcat you would like to share, that would be great.

StevenOttoG commented 6 years ago

@avirodov Right now we haven't reproduced it on one of our devices. If we manage to do it I will attach the log.

inio commented 6 years ago

Closing for inactivity. Feel free to reopen if you manage to catch a repro.

vishusidana95 commented 6 years ago

Can you please give any update regarding this as I am getting same error.

inio commented 6 years ago

@vishusidana95 Can you capture a logcat? onResume really shouldn't be failing with FatalException.

bhaskard commented 6 years ago

@inio I have got the same issue, please find the logs below


07-13 00:01:06.124 16596-16997/com.ar.tweetility I/native: cameras.cc:715 Camera changed state from 0 to 1: Camera device opened succesfully.
    cameras.cc:715 Camera changed state from 1 to 2: Capture session starting...
    cameras.cc:715 Camera changed state from 2 to 3: Capture session started streaming.
07-13 00:01:06.147 16596-16596/com.ar.tweetility D/ViewRootImpl@2faa115[ViewRenderableWindow]: setView = android.widget.FrameLayout{d092c2a V.E...... ......I. 0,0-0,0} TM=true MM=false
07-13 00:01:06.165 16596-16596/com.ar.tweetility E/native: session.cc:970 FrameHitTest while not tracking. Returning empty list.
07-13 00:01:06.195 16596-16596/com.ar.tweetility D/ViewRootImpl@1bde63c[TweetARActivity]: Relayout returned: old=[0,0][1080,2220] new=[0,0][1080,2220] result=0x3 surface={valid=true 501944938496} changed=false
07-13 00:01:06.437 16596-16596/com.ar.tweetility D/ViewRootImpl@2faa115[ViewRenderableWindow]: dispatchAttachedToWindow
07-13 00:01:06.494 16596-16596/com.ar.tweetility V/Surface: sf_framedrop debug : 0x4f4c, game : false, logging : 0
07-13 00:01:06.496 16596-16596/com.ar.tweetility D/ViewRootImpl@2faa115[ViewRenderableWindow]: Relayout returned: old=[0,0][0,0] new=[540,1110][540,1110] result=0x7 surface={valid=true 501954605056} changed=true
07-13 00:01:06.498 16596-16947/com.ar.tweetility D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, egl_color_buffer_format *, EGLBoolean) returns 0x3000,  [1080x2148]-format:2
07-13 00:01:06.527 16596-16730/com.ar.tweetility D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, egl_color_buffer_format *, EGLBoolean) returns 0x3000,  [1x1]-format:1
07-13 00:01:06.527 16596-16730/com.ar.tweetility D/OpenGLRenderer: eglCreateWindowSurface = 0x750bda6f60
07-13 00:01:06.528 16596-16596/com.ar.tweetility D/ViewRootImpl@1bde63c[TweetARActivity]: MSG_RESIZED_REPORT: frame=Rect(0, 0 - 1080, 2220) ci=Rect(0, 72 - 0, 0) vi=Rect(0, 72 - 0, 0) or=1
    MSG_WINDOW_FOCUS_CHANGED 1
07-13 00:01:06.537 16596-16596/com.ar.tweetility V/InputMethodManager: Starting input: tba=android.view.inputmethod.EditorInfo@b713991 nm : com.ar.tweetility ic=null
07-13 00:01:06.537 16596-16596/com.ar.tweetility I/InputMethodManager: startInputInner - mService.startInputOrWindowGainedFocus
07-13 00:01:06.626 16596-16596/com.ar.tweetility D/ViewRootImpl@1bde63c[TweetARActivity]: Relayout returned: old=[0,0][1080,2220] new=[0,0][1080,2220] result=0x1 surface={valid=true 501944938496} changed=false
07-13 00:01:06.647 16596-16596/com.ar.tweetility D/SurfaceView: BG show() Surface(name=Background for - SurfaceView - com.ar.tweetility/com.ar.tweetility.TweetARActivity@94dd859@0) com.google.ar.sceneform.ArSceneView{94dd859 V.E...... ......ID 0,0-1080,2220 #7f080024 app:id/ar_scene_view}
07-13 00:01:06.650 16596-16596/com.ar.tweetility D/SurfaceView: surfaceChanged (1080,2220) 1 com.google.ar.sceneform.ArSceneView{94dd859 V.E...... ......ID 0,0-1080,2220 #7f080024 app:id/ar_scene_view}
07-13 00:01:07.043 16596-16596/com.ar.tweetility D/ViewRootImpl@2faa115[ViewRenderableWindow]: MSG_RESIZED_REPORT: frame=Rect(540, 1110 - 540, 1110) ci=Rect(0, 0 - 0, 0) vi=Rect(0, 0 - 0, 0) or=1
07-13 00:01:07.084 16596-16596/com.ar.tweetility D/ViewRootImpl@1bde63c[TweetARActivity]: Relayout returned: old=[0,0][1080,2220] new=[0,0][1080,2220] result=0x1 surface={valid=true 501944938496} changed=false
07-13 00:01:07.239 16596-16730/com.ar.tweetility D/OpenGLRenderer: eglDestroySurface = 0x750bda4bc0
07-13 00:01:07.256 16596-16596/com.ar.tweetility D/ViewRootImpl@acb3399[SplashActivity]: Relayout returned: old=[0,0][1080,2220] new=[0,0][1080,2220] result=0x5 surface={valid=false 0} changed=true
07-13 00:01:07.340 16596-16596/com.ar.tweetility D/ViewRootImpl@acb3399[SplashActivity]: dispatchDetachedFromWindow
07-13 00:01:07.341 16596-16596/com.ar.tweetility D/InputEventReceiver: channel 'dc0c3fa com.ar.tweetility/com.ar.tweetility.activities.SplashActivity (client)' ~ Disposing input event receiver.
    channel 'dc0c3fa com.ar.tweetility/com.ar.tweetility.activities.SplashActivity (client)' ~NativeInputEventReceiver.
07-13 00:01:10.976 16596-16689/com.ar.tweetility V/FA: Inactivity, disconnecting from the service
07-13 00:01:15.767 16596-16751/com.ar.tweetility D/ACameraDevice: Device error received, code 3, frame number 9, request ID 0, subseq ID 0
07-13 00:01:15.770 16596-17109/com.ar.tweetility E/native: android_camera.cc:1062 Camera capture failed! frame: 9 reason: 1
07-13 00:01:18.768 16596-16751/com.ar.tweetility D/ACameraDevice: Device error received, code 3, frame number 10, request ID 0, subseq ID 0
07-13 00:01:18.768 16596-17109/com.ar.tweetility E/native: android_camera.cc:1062 Camera capture failed! frame: 10 reason: 1
07-13 00:01:21.769 16596-16751/com.ar.tweetility D/ACameraDevice: Device error received, code 3, frame number 11, request ID 0, subseq ID 0
07-13 00:01:21.770 16596-17109/com.ar.tweetility E/native: android_camera.cc:1062 Camera capture failed! frame: 11 reason: 1
07-13 00:01:24.770 16596-16751/com.ar.tweetility D/ACameraDevice: Device error received, code 3, frame number 12, request ID 0, subseq ID 0
07-13 00:01:24.771 16596-17109/com.ar.tweetility E/native: android_camera.cc:1062 Camera capture failed! frame: 12 reason: 1
07-13 00:01:26.376 16596-16689/com.ar.tweetility V/FA: Recording user engagement, ms: 20429
07-13 00:01:26.378 16596-16730/com.ar.tweetility D/OpenGLRenderer: eglDestroySurface = 0x750bda6f60
07-13 00:01:26.379 16596-16689/com.ar.tweetility V/FA: Connecting to remote service
07-13 00:01:26.380 16596-16596/com.ar.tweetility I/native: session.cc:499 Entering Session::Pause.
07-13 00:01:26.408 16596-16689/com.ar.tweetility V/FA: Activity paused, time: 74976424
07-13 00:01:26.422 16596-16689/com.ar.tweetility D/FA: Logging event (FE): user_engagement(_e), Bundle[{firebase_event_origin(_o)=auto, engagement_time_msec(_et)=20429, firebase_screen_class(_sc)=TweetARActivity, firebase_screen_id(_si)=-6159858243845003739}]
07-13 00:01:26.462 16596-16689/com.ar.tweetility V/FA: Connection attempt already in progress
07-13 00:01:27.409 16596-16596/com.ar.tweetility W/native: cameras.cc:745 Callback un-set operation never completed. Can't guarantee there won't be another ImageReader callback.
07-13 00:01:27.421 16596-16997/com.ar.tweetility I/native: cameras.cc:715 Camera changed state from 3 to 4: Capture session stopping...
07-13 00:01:27.770 16596-16751/com.ar.tweetility D/ACameraDevice: Device error received, code 3, frame number 13, request ID 0, subseq ID 0
07-13 00:01:27.771 16596-17109/com.ar.tweetility E/native: android_camera.cc:1062 Camera capture failed! frame: 13 reason: 1
07-13 00:01:29.420 16596-16596/com.ar.tweetility E/native: android_camera.cc:626 Reset: Resetting camera 0 from an ERROR state, best effort clean-up commencing
07-13 00:01:34.433 16596-16751/com.ar.tweetility D/ACameraDevice: Device error received, code 1, frame number 0, request ID -1, subseq ID 0
07-13 00:01:36.171 16596-16596/com.ar.tweetility W/ACameraCaptureSession: Device is closed but session 0 is not notified
07-13 00:01:36.172 16596-16596/com.ar.tweetility I/native: android_camera.cc:991 Capture session closed for camera 0
07-13 00:01:36.190 16596-16596/com.ar.tweetility V/third_party/redwood/base/jni_common/jni_helper.cc: JniHelper: about to attach thread. (Called from line 54.)
    JniHelper: thread already attached. (Called from line 54.)
07-13 00:01:36.207 16596-16596/com.ar.tweetility V/third_party/redwood/base/jni_common/jni_helper.cc: ~JniHelper: did not need to detach thread. (Called from line 54.)
07-13 00:01:36.207 16596-16596/com.ar.tweetility I/native: session.cc:558 Session::Pause returning OK.
07-13 00:01:36.218 16596-16967/com.ar.tweetility V/third_party/redwood/base/jni_common/jni_helper.cc: ~JniHelper: about to detach thread. (Called from line 188.)
    ~JniHelper: detached thread. (Called from line 188.)
07-13 00:01:36.220 16596-16596/com.ar.tweetility I/Choreographer: Skipped 591 frames!  The application may be doing too much work on its main thread.
07-13 00:01:36.225 16596-16596/com.ar.tweetility D/ViewRootImpl@2faa115[ViewRenderableWindow]: dispatchDetachedFromWindow
07-13 00:01:36.226 16596-16596/com.ar.tweetility D/InputEventReceiver: channel 'bdf4b97 ViewRenderableWindow (client)' ~ Disposing input event receiver.
    channel 'bdf4b97 ViewRenderableWindow (client)' ~NativeInputEventReceiver.
07-13 00:01:36.293 16596-16596/com.ar.tweetility D/ViewRootImpl@1bde63c[TweetARActivity]: MSG_WINDOW_FOCUS_CHANGED 0
07-13 00:01:36.304 16596-16596/com.ar.tweetility D/ViewRootImpl@1bde63c[TweetARActivity]: MSG_WINDOW_FOCUS_CHANGED 1
07-13 00:01:36.332 16596-16689/com.ar.tweetility V/FA: Connection attempt already in progress
07-13 00:01:36.352 16596-16689/com.ar.tweetility V/FA: Activity resumed, time: 74986391
07-13 00:01:36.353 16596-16596/com.ar.tweetility I/native: session.cc:417 Entering Session::Resume.
07-13 00:01:36.354 16596-16596/com.ar.tweetility V/third_party/redwood/base/jni_common/jni_helper.cc: JniHelper: about to attach thread. (Called from line 44.)
    JniHelper: thread already attached. (Called from line 44.)
07-13 00:01:36.364 16596-16596/com.ar.tweetility V/third_party/redwood/base/jni_common/jni_helper.cc: ~JniHelper: did not need to detach thread. (Called from line 44.)
07-13 00:01:36.367 16596-16596/com.ar.tweetility I/native: android_sensors.cc:94 Starting thread.
07-13 00:01:36.369 16596-16596/com.ar.tweetility E/NdkImageReader: AImageReader_getWindow
07-13 00:01:36.382 16596-18470/com.ar.tweetility I/native: android_sensors.cc:140 Gyro min delay 2ms requesting 5ms
07-13 00:01:36.390 16596-18471/com.ar.tweetility V/Surface: sf_framedrop debug : 0x4f4c, game : false, logging : 0
07-13 00:01:36.397 16596-18470/com.ar.tweetility I/native: android_sensors.cc:157 Accel min delay 2ms requesting 5ms
07-13 00:01:36.692 16596-16596/com.ar.tweetility E/BufferQueueProducer: [ImageReader-640x480f23u3m16-16596-0] connect: already connected (cur=4 req=4)
07-13 00:01:36.698 16596-16596/com.ar.tweetility E/ACameraDevice: Camera device 0 cannnot support app output configuration: Status(-8): '3: endConfigure:434: Camera 0: Unsupported set of inputs/outputs provided'
    Fail to create new session. cannot configure streams
07-13 00:01:36.698 16596-16596/com.ar.tweetility E/native: android_camera.cc:626 Reset: Resetting camera 0 from an ERROR state, best effort clean-up commencing
07-13 00:01:36.692 16596-16596/com.ar.tweetility E/BufferQueueProducer: [ImageReader-640x480f23u3m16-16596-0] connect: already connected (cur=4 req=4)
07-13 00:01:36.698 16596-16596/com.ar.tweetility E/ACameraDevice: Camera device 0 cannnot support app output configuration: Status(-8): '3: endConfigure:434: Camera 0: Unsupported set of inputs/outputs provided'
    Fail to create new session. cannot configure streams
07-13 00:01:36.698 16596-16596/com.ar.tweetility E/native: android_camera.cc:626 Reset: Resetting camera 0 from an ERROR state, best effort clean-up commencing
07-13 00:01:37.093 16596-16596/com.ar.tweetility I/native: android_data_source.cc:243 Failed to start cameras.
07-13 00:01:37.113 16596-16596/com.ar.tatility W/native: session.cc:488 Session::Resume returning generic::failed_precondition: ACameraDevice_createCaptureSession.
07-13 00:01:37.115 16596-16596/com.ar.tatility E/native: status.cc:158 generic::failed_precondition: ACameraDevice_createCaptureSession
07-13 00:01:37.124 16596-16596/com.ar.tatility D/AndroidRuntime: Shutting down VM
07-13 00:01:37.138 16596-16596/com.ar.tatility E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.ar.tweetility, PID: 16596
    java.lang.RuntimeException: Unable to resume activity {com.ar.tatility/com.ar.taility.TARActivity}: com.google.ar.core.exceptions.FatalException
        at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3788)
        at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3828)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1746)
        at android.os.Handler.dispatchMessage(Handler.java:105)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6938)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
     Caused by: com.google.ar.core.exceptions.FatalException
        at com.google.ar.core.Session.throwExceptionFromArStatus(Unknown Source:43)
        at com.google.ar.core.Session.nativeResume(Native Method)
        at com.google.ar.core.Session.resume(Unknown Source:2)
        at com.google.ar.sceneform.ArSceneView.resume(Unknown Source:7)
        at com.ar.tatility.TARActivity.onResume(TweetARActivity.java:472)
        at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1361)
        at android.app.Activity.performResume(Activity.java:7344)
        at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3763)```
avirodov commented 6 years ago

Hi, thank you for the log, this is very useful. Few questions:

  1. Can I please have the device fingerprint where this issue occurred? You can get it with adb shell getprop ro.build.fingerprint.
  2. How often does this happen?
  3. If this happens, is the device in "bad state", and this would continue to happen? Would that bad state clear after device restart? Are other camera apps affected?

From the log, this may be a proper fatal exception where the camera system gets into a bad state, and there isn't much we can do about it. But I will be happy to have more data.

bhaskard commented 6 years ago
  1. samsung/dreamltexx/dreamlte:8.0.0/R16NW/G950FXXU2CRF7:user/release-keys
  2. 3 out of 6 times
  3. after killing the app and reopening it, it works properly
avirodov commented 6 years ago

Thank you for this additional information. Another question: does this happen with any ARCore app? Or some specific app? Can you get this behavior happening with HelloAR Java/C sample apps?

Also, to confirm, does restarting the device change the behavior in any way?

bhaskard commented 6 years ago

will check with Hellow AR app and will let you know.

Yes, restarting the app solves the issue

Calence commented 6 years ago

Has it been resolved?

MDikkii commented 5 years ago

Hi, I have the same Exception when I start application on locked device screen. It's about camera permissions: E/ACameraManager: openCamera: connect camera device failed: Status(-8): '6: validateClientPermissionsLocked:915: Caller "" (PID 10174, UID 6883) cannot open camera "0" from background' E/native: android_camera.cc:701 Reset: Resetting camera 0 from an ERROR state, best effort clean-up commencing I/native: android_data_source.cc:292 Failed to start cameras.

inio commented 5 years ago

@MDikkii That seems to be a completely separate issue. Are you starting the app while the device is locked?

MDikkii commented 5 years ago

For me it isn't. There is a problem with camera (camera cannot be opened in the background) and then FatalException is thrown. I assume it should be CameraNotAvailableException again.

And yes, I'm starting the app while the device is locked (via adb). I forgot to unlock it and then this FatalException occurs. I know that the user won't lunch app like this, anyway I don't know if FatalException is the best Exception for it.

NotASingleSingelton commented 5 years ago

This is still an issue got the same stacktraces:

java.lang.RuntimeException:

at android.app.ActivityThread.performResumeActivity (ActivityThread.java:3790) at android.app.ActivityThread.handleResumeActivity (ActivityThread.java:3830)
at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3038)
at android.app.ActivityThread.-wrap11 (Unknown Source)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1696)
at android.os.Handler.dispatchMessage (Handler.java:105)
at android.os.Looper.loop (Looper.java:164)
at android.app.ActivityThread.main (ActivityThread.java:6944)
at java.lang.reflect.Method.invoke (Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:327)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1374)

Caused by: com.google.ar.core.exceptions.FatalException: at com.google.ar.core.U.b (Unknown Source:2) at com.google.ar.core.Session.throwExceptionFromArStatus (Unknown Source:14) at com.google.ar.core.Session.nativeResume (Native Method) at com.google.ar.core.Session.resume (Unknown Source:2) at com.google.ar.sceneform.ArSceneView.resume (Unknown Source:7) at com.google.ar.sceneform.ux.BaseArFragment.start (SourceFile:453) at com.google.ar.sceneform.ux.BaseArFragment.onResume (SourceFile:299) at android.support.v4.app.Fragment.performResume (SourceFile:2390) at android.support.v4.app.FragmentManagerImpl.moveToState (SourceFile:1474) at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState (SourceFile:1759) at android.support.v4.app.FragmentManagerImpl.moveToState (SourceFile:1827) at android.support.v4.app.FragmentManagerImpl.dispatchStateChange (SourceFile:3244) at android.support.v4.app.FragmentManagerImpl.dispatchResume (SourceFile:3212) at android.support.v4.app.FragmentController.dispatchResume (SourceFile:217) at android.support.v4.app.FragmentActivity.onResumeFragments (SourceFile:509) at android.support.v4.app.FragmentActivity.onPostResume (SourceFile:498) at android.support.v7.app.AppCompatActivity.onPostResume (SourceFile:171) at android.app.Activity.performResume (Activity.java:7385) at android.app.ActivityThread.performResumeActivity (ActivityThread.java:3765)

Happened on the devices: Samsung Galaxy A8(2018) (jackpotlte), Android 8.0 Samsung Galaxy S8 (dreamlte), Android 8.0

So its still an FatalException.

vaibhavreddys commented 5 years ago

@inio I was able to reproduce this issue in a much simpler way on my Pixel 2 XL Keep the device locked and build the application from android-studio. Android studio tries to launch the app while the device is in the locked state and when the device is unlocked you get "Unable to resume activity" exception.

Logcat: 2018-10-25 15:07:25.990 9923-9923/com.google.ar.core.examples.java.helloar E/AndroidRuntime: FATAL EXCEPTION: main Process: com.google.ar.core.examples.java.helloar, PID: 9923 java.lang.RuntimeException: Unable to resume activity {com.google.ar.core.examples.java.helloar/com.google.ar.core.examples.java.helloar.HelloArActivity}: com.google.ar.core.exceptions.FatalException at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3784) 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) Caused by: com.google.ar.core.exceptions.FatalException at com.google.ar.core.U.b(Unknown Source:2) at com.google.ar.core.Session.throwExceptionFromArStatus(Unknown Source:14) at com.google.ar.core.Session.nativeResume(Native Method) at com.google.ar.core.Session.resume(Unknown Source:2) at com.google.ar.core.examples.java.helloar.HelloArActivity.onResume(HelloArActivity.java:335) 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) 

Kanunnikoff commented 5 years ago

Also have the same problem after the dialog with permissions request has disappeared:

2018-11-15 17:25:21.038 19284-19284/software.kanunnikoff.furniturear E/BufferQueueProducer: [ImageReader-640x480f23u3m16-19284-1] connect: already connected (cur=4 req=4) 2018-11-15 17:25:21.039 19284-19284/software.kanunnikoff.furniturear E/ACameraDevice: Camera device 0 cannnot support app output configuration: Status(-8): '3: endConfigure:434: Camera 0: Unsupported set of inputs/outputs provided' 2018-11-15 17:25:21.039 19284-19284/software.kanunnikoff.furniturear E/ACameraDevice: Fail to create new session. cannot configure streams 2018-11-15 17:25:21.179 19284-19284/software.kanunnikoff.furniturear I/native: android_data_source.cc:292 Failed to start cameras. 2018-11-15 17:25:21.191 19284-19284/software.kanunnikoff.furniturear W/native: session.cc:592 Session::Resume returning generic::failed_precondition: ACameraDevice_createCaptureSession. 2018-11-15 17:25:21.191 19284-19284/software.kanunnikoff.furniturear E/native: status.cc:155 generic::failed_precondition: ACameraDevice_createCaptureSession 2018-11-15 17:25:21.223 19284-19284/software.kanunnikoff.furniturear D/AndroidRuntime: Shutting down VM 2018-11-15 17:25:21.232 19284-19284/software.kanunnikoff.furniturear E/AndroidRuntime: FATAL EXCEPTION: main Process: software.kanunnikoff.furniturear, PID: 19284 java.lang.RuntimeException: Unable to resume activity {ArActivity}: com.google.ar.core.exceptions.FatalException at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3788) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3828) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1746) at android.os.Handler.dispatchMessage(Handler.java:105) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6938) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374) Caused by: com.google.ar.core.exceptions.FatalException at com.google.ar.core.U.b(Unknown Source:2) at com.google.ar.core.Session.throwExceptionFromArStatus(Unknown Source:14) at com.google.ar.core.Session.nativeResume(Native Method) at com.google.ar.core.Session.resume(Unknown Source:2) at com.google.ar.sceneform.ArSceneView.resume(Unknown Source:7) at com.google.ar.sceneform.ux.BaseArFragment.start(BaseArFragment.java:453) at com.google.ar.sceneform.ux.BaseArFragment.onResume(BaseArFragment.java:299) at androidx.fragment.app.Fragment.performResume(Fragment.java:2498) at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManager.java:1501) at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1784) at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManager.java:1852) at androidx.fragment.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3269) at androidx.fragment.app.FragmentManagerImpl.dispatchResume(FragmentManager.java:3241) at androidx.fragment.app.FragmentController.dispatchResume(FragmentController.java:223) at androidx.fragment.app.FragmentActivity.onResumeFragments(FragmentActivity.java:538) at androidx.fragment.app.FragmentActivity.onPostResume(FragmentActivity.java:527) at androidx.appcompat.app.AppCompatActivity.onPostResume(AppCompatActivity.java:172) at android.app.Activity.performResume(Activity.java:7377) at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3763) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3828)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1746)  at android.os.Handler.dispatchMessage(Handler.java:105)  at android.os.Looper.loop(Looper.java:164)  at android.app.ActivityThread.main(ActivityThread.java:6938)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374) 

Samsung Galaxy S8+, Android Oreo 8.0, ARCore 1.5.3 (apk), Sceneform 1.5.1.

littleylv commented 5 years ago

Hi. I also got that com.google.ar.core.exceptions.FatalException in MainActivity.onResume with Galaxy S8 (dreamlte)/Galaxy S8 (dreamlteks)/Galaxy S9+ (star2qltechn) . Some of my users are complaining about my app's crashing 😭

    implementation 'com.google.ar:core:1.5.0'
    implementation 'com.google.ar.sceneform:core:1.5.1'
    implementation 'com.google.ar.sceneform.ux:sceneform-ux:1.5.1'
136296634mn commented 5 years ago

Hi. I also got that com.google.ar.core.exceptions.FatalException in MainActivity.onResume with xiaomi 8 . how to solved?

136296634mn commented 5 years ago

的版本问题,藏尸回退一个版本就解决了,这应该事google arcore的一个bug

我已经解决,问题事arcore.apk的版本问题,藏尸回退一个版本就解决了,这应该事google arcore的一个bug Wǒ yǐjīng jiějué, wèntí shì arcore.Apk de bǎnběn wèntí, cáng shī huí tuì yīgè bǎnběn jiù jiějuéle, zhè yīnggāi shì google arcore de yīgè bug I have solved the problem with the version of arcore.apk. The corpse is retired and a version is solved. This should be a bug in google arcore. @StevenOttoG @inio @avirodov @vishusidana95 @bhaskard

IdaRiseng commented 5 years ago

Hi! I also got this exception on my samsung s7 edge. Is there a way to catch this exception, instead of rolling back to older versions? I feel like i have try-catches everywhere, but it still doesnt catch this exception.

136296634mn commented 5 years ago

Hi! I also got this exception on my samsung s7 edge. Is there a way to catch this exception, instead of rolling back to older versions? I feel like i have try-catches everywhere, but it still doesnt catch this exception.

The latest arcore.apk version has been resolved

MuhammamdArslanKhan commented 5 years ago

facing same issue "Unable to resume activity"

Emulator specifications Pixel 2 8.1 (Oreo) - API 27 Emulator version 27.3.10-4969155

Android Studio 3.5 Build #AI-191.8026.42.35.5791312, built on August 9, 2019 JRE: 1.8.0_202-release-1483-b03 amd64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Windows 10 10.0

I have tried ndk hello c/java but same issue. Stuck for almost 10 days.

2019-09-03 17:33:03.442 15104-15134/com.google.ar.sceneform.samples.hellosceneform E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008a30 2019-09-03 17:33:03.442 15104-15134/com.google.ar.sceneform.samples.hellosceneform E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008a30 2019-09-03 17:33:05.485 15104-15104/com.google.ar.sceneform.samples.hellosceneform E/NdkImageReader: AImageReader_getWindow 2019-09-03 17:33:09.030 15104-15104/com.google.ar.sceneform.samples.hellosceneform E/native: android_camera.cc:632 Camera 0: State ERROR: Resetting camera from an ERROR state, best effort clean-up commencing. 2019-09-03 17:33:09.421 15104-15104/com.google.ar.sceneform.samples.hellosceneform E/native: status.cc:153 generic::deadline_exceeded: Camera 0: State ERROR: Timed out waiting for OPEN => CAPTURING 2019-09-03 17:33:09.437 15104-15104/com.google.ar.sceneform.samples.hellosceneform E/AndroidRuntime: FATAL EXCEPTION: main Process: com.google.ar.sceneform.samples.hellosceneform, PID: 15104 java.lang.RuntimeException: Unable to resume activity {com.google.ar.sceneform.samples.hellosceneform/com.google.ar.sceneform.samples.hellosceneform.HelloSceneformActivity}: com.google.ar.core.exceptions.FatalException at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3581) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3621) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2862) at android.app.ActivityThread.-wrap11(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6494) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) Caused by: com.google.ar.core.exceptions.FatalException at java.lang.reflect.Constructor.newInstance0(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:334) at com.google.ar.core.Session.throwExceptionFromArStatus(Session.java:145) at com.google.ar.core.Session.nativeResume(Native Method) at com.google.ar.core.Session.resume(Session.java:70) at com.google.ar.sceneform.ArSceneView.resumeSession(SourceFile:50) at com.google.ar.sceneform.ArSceneView.resume(SourceFile:39) at com.google.ar.sceneform.ux.BaseArFragment.start(BaseArFragment.java:507) at com.google.ar.sceneform.ux.BaseArFragment.onResume(BaseArFragment.java:315) at android.support.v4.app.Fragment.performResume(Fragment.java:2498) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1501) at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1784) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1852) at android.support.v4.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3269) at android.support.v4.app.FragmentManagerImpl.dispatchResume(FragmentManager.java:3241) at android.support.v4.app.FragmentController.dispatchResume(FragmentController.java:223) at android.support.v4.app.FragmentActivity.onResumeFragments(FragmentActivity.java:538) at android.support.v4.app.FragmentActivity.onPostResume(FragmentActivity.java:527) at android.support.v7.app.AppCompatActivity.onPostResume(AppCompatActivity.java:172) at android.app.Activity.performResume(Activity.java:7141) at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3556) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3621)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2862)  at android.app.ActivityThread.-wrap11(Unknown Source:0)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)  at android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loop(Looper.java:164)  at android.app.ActivityThread.main(ActivityThread.java:6494)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)  2019-09-03 17:33:09.511 15104-15204/com.google.ar.sceneform.samples.hellosceneform E/BufferQueueProducer: [SurfaceTexture-0-15104-0] queueBuffer: BufferQueue has been abandoned 2019-09-03 17:33:09.518 15104-15204/com.google.ar.sceneform.samples.hellosceneform E/BufferQueueProducer: [ImageReader-640x480f23u3m16-15104-0] queueBuffer: BufferQueue has been abandoned 2019-09-03 17:33:09.550 15104-15192/com.google.ar.sceneform.samples.hellosceneform E/BufferQueueProducer: [SurfaceTexture-0-15104-0] dequeueBuffer: BufferQueue has been abandoned 2019-09-03 17:33:09.728 15104-15192/com.google.ar.sceneform.samples.hellosceneform E/BufferQueueProducer: [SurfaceTexture-0-15104-0] queueBuffer: BufferQueue has been abandoned 2019-09-03 17:33:09.729 15104-15192/com.google.ar.sceneform.samples.hellosceneform E/BufferQueueProducer: [ImageReader-640x480f23u3m16-15104-0] queueBuffer: BufferQueue has been abandoned

mws-rmain commented 5 years ago

I have a similar problem with an app I'm responsible for maintaining. Possibly related to: this stackoverflow issue? In my case, reported crashes were all on samsung platforms, running Android 9+. From the Google fix, it appears 'onResume()' was being called before the activity was 'fully' in the foreground.

chnouman commented 4 years ago
data:text/text;charset=utf-8,
java.lang.RuntimeException: Unable to resume activity {com.xyz.xyz.main/com.xyz.xyz.main.arloop.main.MainActivity}: com.google.ar.core.exceptions.FatalException
     at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4009)
     at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4041)
     at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:52)
     at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176)
     at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1935)
     at android.os.Handler.dispatchMessage(Handler.java:107)
     at android.os.Looper.loop(Looper.java:214)
     at android.app.ActivityThread.main(ActivityThread.java:7116)
     at java.lang.reflect.Method.invoke(Native Method)
     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:925)

Caused by: 
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:145)
     at com.google.ar.core.Session.nativeResume(Native Method)
     at com.google.ar.core.Session.resume(Session.java:70)
     at com.google.ar.sceneform.ArSceneView.resumeSession(SourceFile:50)
     at com.google.ar.sceneform.ArSceneView.resume(SourceFile:39)
     at com.google.ar.sceneform.ux.BaseArFragment.start(BaseArFragment.java:507)
     at com.google.ar.sceneform.ux.BaseArFragment.onResume(BaseArFragment.java:315)
     at androidx.fragment.app.Fragment.performResume(Fragment.java:2718)
     at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1364)
     at androidx.fragment.app.FragmentManager.moveFragmentToExpectedState(FragmentManager.java:1686)
     at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1750)
     at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3074)
     at androidx.fragment.app.FragmentManager.dispatchResume(FragmentManager.java:3040)
     at androidx.fragment.app.FragmentController.dispatchResume(FragmentController.java:269)
     at androidx.fragment.app.FragmentActivity.onResumeFragments(FragmentActivity.java:478)
     at androidx.fragment.app.FragmentActivity.onPostResume(FragmentActivity.java:467)
     at androidx.appcompat.app.AppCompatActivity.onPostResume(AppCompatActivity.java:195)
     at android.app.Activity.performResume(Activity.java:7860)
     at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3999)
     at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4041)
     at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:52)
     at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176)
     at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1935)
     at android.os.Handler.dispatchMessage(Handler.java:107)
     at android.os.Looper.loop(Looper.java:214)
     at android.app.ActivityThread.main(ActivityThread.java:7116)
     at java.lang.reflect.Method.invoke(Native Method)
     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:925)
dkshin2760 commented 4 years ago

Fatal Exception: java.lang.RuntimeException: Unable to resume activity {my.package.activity}: com.google.ar.core.exceptions.FatalException at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4021) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4053) 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:1955) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7078) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:964)

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.