arcore-android-sdk icon indicating copy to clipboard operation
arcore-android-sdk copied to clipboard

App crashes with Google Play Services for AR 1.32

Open mkrautz opened this issue 3 years ago • 6 comments

SPECIFIC ISSUE ENCOUNTERED

App crashes when entering AR mode. This happens with Google Play Services for AR 1.32. Version 1.31 works fine.

VERSIONS USED

Unity version 2019.4.34f1 LTS ARCore XR plugin version 4.1.9 Device manufacturer, model, and O/S: Samsung Galaxy S21 5G, Samsung Galaxy S21 Ultra, Huawei P20 Pro Google Play Services for AR (ARCore): 1.32.221520033

STEPS TO REPRODUCE THE ISSUE

  1. Download https://play.google.com/store/apps/details?id=dk.rationel.designer&hl=en&gl=US
  2. Click "Scan din facade".
  3. App crashes.

WORKAROUNDS (IF ANY)

We can work around the issue by downgrading Google Play Services for AR to 1.31.

ADDITIONAL COMMENTS

Logcat output and stack trace from Galaxy S21 5G - looks the same for the other devices...:

08-09 10:49:00.151 28970 29272 F native  : === Source Location Trace: ===
08-09 10:49:00.151 28970 29272 F native  : third_party/arcore/ar/camera/android/camera_image_stream.cc:85
08-09 10:49:00.151 28970 29272 F native  : ) 
08-09 10:49:00.151 28970 29272 F native  : terminating.
08-09 10:49:00.151 28970 29272 F native  : F0000 00:00:1660034940.151055   29272 cameras.cc:1629] Check failed: image_stream_context.image_stream->WaitForAllImagesReturned() is OK (DEADLINE_EXCEEDED: Camera Image Stream timed out waiting for images to be returned.
08-09 10:49:00.151 28970 29272 F native  : === Source Location Trace: ===
08-09 10:49:00.151 28970 29272 F native  : third_party/arcore/ar/camera/android/camera_image_stream.cc:85
08-09 10:49:00.151 28970 29272 F native  : ) 
08-09 10:49:00.151 28970 29272 F native  : terminating.
08-09 10:49:00.170 28970 29272 E CRASH   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
08-09 10:49:00.170 28970 29272 E CRASH   : Version '2019.4.34f1 (6a9faed444f2)', Build type 'Release', Scripting Backend 'il2cpp', CPU 'arm64-v8a'
08-09 10:49:00.170 28970 29272 E CRASH   : Build fingerprint: 'samsung/o1sxeea/o1s:12/SP1A.210812.016/G991BXXU3BUK8:user/release-keys'
08-09 10:49:00.170 28970 29272 E CRASH   : Revision: '22'
08-09 10:49:00.170 28970 29272 E CRASH   : ABI: 'arm64'
08-09 10:49:00.170 28970 29272 E CRASH   : Timestamp: 2022-08-09 10:49:00+0200
08-09 10:49:00.170 28970 29272 E CRASH   : pid: 28970, tid: 29272, name: cameras_async_w  >>> dk.rationel.designer <<<
08-09 10:49:00.170 28970 29272 E CRASH   : uid: 10357
08-09 10:49:00.170 28970 29272 E CRASH   : signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
08-09 10:49:00.170 28970 29272 E CRASH   :     x0  0000000000000000  x1  0000000000007258  x2  0000000000000006  x3  0000006ab22f95c0
08-09 10:49:00.170 28970 29272 E CRASH   :     x4  1f1eff092d666d68  x5  1f1eff092d666d68  x6  1f1eff092d666d68  x7  7f7f7f7f7f7f7f7f
08-09 10:49:00.170 28970 29272 E CRASH   :     x8  00000000000000f0  x9  76319b7d2f04a4d0  x10 0000000000000000  x11 ffffff80fffffbdf
08-09 10:49:00.170 28970 29272 E CRASH   :     x12 0000000000000001  x13 000000000000000e  x14 0000000000000000  x15 0000000026762762
08-09 10:49:00.170 28970 29272 E CRASH   :     x16 0000006fb51f2058  x17 0000006fb51cf630  x18 0000006ab11e2000  x19 000000000000712a
08-09 10:49:00.170 28970 29272 E CRASH   :     x20 0000000000007258  x21 00000000ffffffff  x22 b400006d3ed12d70  x23 00fefefefefefefe
08-09 10:49:00.170 28970 29272 E CRASH   :     x24 b400006dbee16560  x25 0000006ab22f99c0  x26 0000006ab22f9a70  x27 0000000000000001
08-09 10:49:00.170 28970 29272 E CRASH   :     x28 b400006e0ed934c0  x29 0000006ab22f9640
08-09 10:49:00.170 28970 29272 E CRASH   :     sp  0000006ab22f95a0  lr  0000006fb51820a4  pc  0000006fb51820d0
08-09 10:49:00.170 28970 29272 E CRASH   : backtrace:
08-09 10:49:00.170 28970 29272 E CRASH   :       #00 pc 00000000000510d0  /apex/com.android.runtime/lib64/bionic/libc.so (abort+164) (BuildId: dda896312b8ac9c639f6aeb0175b8a0a)
08-09 10:49:00.170 28970 29272 E CRASH   :       #01 pc 00000000011a7708  /data/app/~~QoWlozkVCwlgCvhMSlvUgA==/com.google.ar.core-ac8uNQL1kGutZ5IrhQdmRw==/base.apk (BuildId: e8918ec98abe0ddfa9870f4850d7f033)
08-09 10:49:00.170 28970 29272 E CRASH   :       #02 pc 00000000011a78a0  /data/app/~~QoWlozkVCwlgCvhMSlvUgA==/com.google.ar.core-ac8uNQL1kGutZ5IrhQdmRw==/base.apk (BuildId: e8918ec98abe0ddfa9870f4850d7f033)
08-09 10:49:00.170 28970 29272 E CRASH   :       #03 pc 00000000011a7528  /data/app/~~QoWlozkVCwlgCvhMSlvUgA==/com.google.ar.core-ac8uNQL1kGutZ5IrhQdmRw==/base.apk (BuildId: e8918ec98abe0ddfa9870f4850d7f033)
08-09 10:49:00.170 28970 29272 E CRASH   :       #04 pc 00000000011a79e8  /data/app/~~QoWlozkVCwlgCvhMSlvUgA==/com.google.ar.core-ac8uNQL1kGutZ5IrhQdmRw==/base.apk (BuildId: e8918ec98abe0ddfa9870f4850d7f033)
08-09 10:49:00.170 28970 29272 E CRASH   :       #05 pc 000000000159d108  /data/app/~~QoWlozkVCwlgCvhMSlvUgA==/com.google.ar.core-ac8uNQL1kGutZ5IrhQdmRw==/base.apk (BuildId: e8918ec98abe0ddfa9870f4850d7f033)
08-09 10:49:00.170 28970 29272 E CRASH   :       #06 pc 00000000015a0bf0  /data/app/~~QoWlozkVCwlgCvhMSlvUgA==/com.google.ar.core-ac8uNQL1kGutZ5IrhQdmRw==/base.apk (BuildId: e8918ec98abe0ddfa9870f4850d7f033)
08-09 10:49:00.170 28970 29272 E CRASH   :       #07 pc 00000000015a28b8  /data/app/~~QoWlozkVCwlgCvhMSlvUgA==/com.google.ar.core-ac8uNQL1kGutZ5IrhQdmRw==/base.apk (BuildId: e8918ec98abe0ddfa9870f4850d7f033)
08-09 10:49:00.170 28970 29272 E CRASH   :       #08 pc 00000000015bbb60  /data/app/~~QoWlozkVCwlgCvhMSlvUgA==/com.google.ar.core-ac8uNQL1kGutZ5IrhQdmRw==/base.apk (BuildId: e8918ec98abe0ddfa9870f4850d7f033)
08-09 10:49:00.170 28970 29272 E CRASH   :       #09 pc 00000000010b4138  /data/app/~~QoWlozkVCwlgCvhMSlvUgA==/com.google.ar.core-ac8uNQL1kGutZ5IrhQdmRw==/base.apk (BuildId: e8918ec98abe0ddfa9870f4850d7f033)
08-09 10:49:00.170 28970 29272 E CRASH   :       #10 pc 00000000000b3090  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+264) (BuildId: dda896312b8ac9c639f6aeb0175b8a0a)
08-09 10:49:00.170 28970 29272 E CRASH   :       #11 pc 00000000000528f4  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: dda896312b8ac9c639f6aeb0175b8a0a)

mkrautz avatar Aug 10 '22 08:08 mkrautz

I think I have the same issue, where can I download the old versión of Google AR Core services? in my app, when I use 2 scenes, the app crash in the second scene. Also only occurs on Android 12, Samsung S21, and POCO F3, on a Samsung a52, with the 1.33 03/08/22 Services works fine.

DanFrag avatar Aug 11 '22 15:08 DanFrag

We never were able to find a good workaround for the older build of the app. We have a new build, with the latest Unity 2021 LTS and latest AR Foundation packages... That starts up with a black screen. What happens is that we create an XRSessionSubsystem in order to query the availability of ARCore before we enter the scene. Then we destroy it.

The newer version of Google Play Services for AR doesn't seem to like that. We changed it to not destroy the created XRSessionSubsystem, and that seemed to fix it for us.

We're still investigating, though. The builds from our CI system still have some weird behavior...

I'll keep you posted once I know more.

mkrautz avatar Aug 11 '22 16:08 mkrautz

We never were able to find a good workaround for the older build of the app. We have a new build, with the latest Unity 2021 LTS and latest AR Foundation packages... That starts up with a black screen. What happens is that we create an XRSessionSubsystem in order to query the availability of ARCore before we enter the scene. Then we destroy it.

The newer version of Google Play Services for AR doesn't seem to like that. We changed it to not destroy the created XRSessionSubsystem, and that seemed to fix it for us.

We're still investigating, though. The builds from our CI system still have some weird behavior...

I'll keep you posted once I know more.

Thank You so much, I will check with my team.

DanFrag avatar Aug 11 '22 20:08 DanFrag

Update: in addition to the above, we also had to drop a loop that looks like this:

XRCpuImage frame;		
while(!cameraManager.TryAcquireLatestCpuImage(out frame))		
    await Task.Yield();		

backgroundWidth = frame.width;		
backgroundHeight = frame.height;		
frame.Dispose();

We did this in our initialization flow to get the size of the background texture. However, the newer Google Play Services for AR didn't feed us CPU images at this point.

Wwe dropped it in favour of a later code path in our app that configures the AR session to use the best available camera config (highest res, most FPS), which gets the backgroundWidth and backgroundHeight via ARCameraManager's TryGetIntrinsics.

mkrautz avatar Aug 12 '22 09:08 mkrautz

Also, @DanFrag, I used apkmirror to download the older APK. Obviously, I don't have a way to verify the legitity of that APK, but it was a burner/test device, so I didn't worry about it. :-)

mkrautz avatar Aug 12 '22 14:08 mkrautz

Also, @DanFrag, I used apkmirror to download the older APK. Obviously, I don't have a way to verify the legitity of that APK, but it was a burner/test device, so I didn't worry about it. :-)

Thank You man, we are solving this right now working with a master scene, so we don't need to destroy AR elements.

DanFrag avatar Aug 12 '22 23:08 DanFrag

On August 20 we pushed a server configuration that should mitigate this issue. From internal testing we've seen good reporting, but please let me know if you're still seeing this pop up.

devbridie avatar Aug 30 '22 17:08 devbridie