- Home /
AR application keeps crashing when permitting camera rights!
Hello,
I'm trying to make a unity AR project. Using Unity 2019.4.5f1 (LTS) and the following packages:
I followed several tutorials, including the official Google quickstart and several using the Unity package manager. Ultimately I just have the scene as described in the tutorials: XR session, XR session origin, Cube and light. But I also used the HelloAR scene from Google. All different apprioaches result in the same error. Here is an image of the scene:
I use a Samsung Galaxy S10 as testing device, which is definitly supported. It has 1 front camera and 3 back cameras. When I launch the app, after the splash screen, I get the question to grand Camera rights too the app. If I deny permission the app does not crash and just shows the 3D scene and cube. But when I do grand permission the app crashes immediatly. Restarting the app after granting permissions also crashes the app after the Unity splash screen. I captured the error log with logcat:
08-20 11:37:34.418 11580 11649 E AndroidRuntime: FATAL EXCEPTION: UnityMain 08-20 11:37:34.418 11580 11649 E AndroidRuntime: Process: com.BlueEngineering.AR, PID: 11580 08-20 11:37:34.418 11580 11649 E AndroidRuntime: java.lang.Error: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 08-20 11:37:34.418 11580 11649 E AndroidRuntime: Version '2019.4.5f1 (81610f64359c)', Build type 'Development', Scripting Backend 'mono', CPU 'armeabi-v7a' 08-20 11:37:34.418 11580 11649 E AndroidRuntime: Build fingerprint: 'samsung/beyond1lteeea/beyond1:10/QP1A.190711.020/G973FXXU8CTG4:user/release-keys' 08-20 11:37:34.418 11580 11649 E AndroidRuntime: Revision: '26' 08-20 11:37:34.418 11580 11649 E AndroidRuntime: ABI: 'arm' 08-20 11:37:34.418 11580 11649 E AndroidRuntime: Timestamp: 2020-08-20 11:37:34+0200 08-20 11:37:34.418 11580 11649 E AndroidRuntime: pid: 11580, tid: 11649, name: UnityMain >>> com.BlueEngineering.AR <<< 08-20 11:37:34.418 11580 11649 E AndroidRuntime: uid: 10443 08-20 11:37:34.418 11580 11649 E AndroidRuntime: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 08-20 11:37:34.418 11580 11649 E AndroidRuntime: Cause: null pointer dereference 08-20 11:37:34.418 11580 11649 E AndroidRuntime: r0 69766544 r1 616c7567 r2 00000000 r3 00000000 08-20 11:37:34.418 11580 11649 E AndroidRuntime: r4 b2c95050 r5 ea143fc0 r6 b2c95050 r7 00000000 08-20 11:37:34.418 11580 11649 E AndroidRuntime: r8 a2719230 r9 80808080 r10 00000000 r11 00000000 08-20 11:37:34.418 11580 11649 E AndroidRuntime: ip a2722890 sp b5caab50 lr a26e3ca7 pc 00000000 08-20 11:37:34.418 11580 11649 E AndroidRuntime: 08-20 11:37:34.418 11580 11649 E AndroidRuntime: managed backtrace: 08-20 11:37:34.418 11580 11649 E AndroidRuntime: #00 (wrapper managed-to-native) UnityEngine.XR.ARCore.ARCoreSessionSubsystem/NativeApi:UnityARCore_session_update (UnityEngine.ScreenOrientation,UnityEngine.Vector2Int) 08-20 11:37:34.418 11580 11649 E AndroidRuntime: #01 UnityEngine.XR.ARCore.ARCoreSessionSubsystem/Provider:Update (UnityEngine.XR.ARSubsystems.XRSessionUpdateParams) 08-20 11:37:34.418 11580 11649 E AndroidRuntime: #02 UnityEngine.XR.ARSubsystems.XRSessionSubsystem:Update (UnityEngine.XR.ARSubsystems.XRSessionUpdateParams) 08-20 11:37:34.418 11580 11649 E AndroidRuntime: #03 UnityEngine.XR.ARFoundation.ARSession:Update () 08-20 11:37:34.418 11580 11649 E AndroidRuntime: #04 (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr) 08-20 11:37:34.418 11580 11649 E AndroidRuntime: 08-20 11:37:34.418 11580 11649 E AndroidRuntime: at UnityEngine.XR.ARCore.ARCoreSessionSubsystem.NativeApi.UnityARCore_session_update (UnityEngine.ScreenOrientation,UnityEngine.Vector2Int)(Native Method) 08-20 11:37:34.418 11580 11649 E AndroidRuntime: at UnityEngine.XR.ARCore.ARCoreSessionSubsystem.Provider.Update (UnityEngine.XR.ARSubsystems.XRSessionUpdateParams)(C:\Users\j.bax\AR\Library\PackageCache\com.unity.xr.arcore@2.1.11\Runtime\ARCoreSessionSubsystem.cs:52) 08-20 11:37:34.418 11580 11649 E AndroidRuntime: at UnityEngine.XR.ARSubsystems.XRSessionSubsystem.Update (UnityEngine.XR.ARSubsystems.XRSessionUpdateParams)(C:\Users\j.bax\AR\Library\PackageCache\com.unity.xr.arsubsystems@2.1.2\Runtime\SessionSubsystem\XRSessionSubsystem.cs:131) 08-20 11:37:34.418 11580 11649 E AndroidRuntime: at UnityEngine.XR.ARFoundation.ARSession.Update ()(C:\Users\j.bax\AR\Library\PackageCache\com.unity.xr.arfoundation@2.1.8\Runtime\AR\ARSession.cs:349) 08-20 11:37:34.418 11580 11649 E AndroidRuntime: at System.Object.runtime_invoke_void__this__ (object,intptr,intptr,intptr)(Native Method)
I also tried re-starting the phone and re-building the package for different API levels, all resulting in the same error.
I suspect it has something to do with the phones cameras not being selected properly? maybe because there are 3?
If someone knows the solution it would be greatly appreciated!
Answer by peterfiveeight · Aug 21, 2020 at 08:31 PM
Hi @JesseAtBlue, I was having the exact same issue, tearing my hair out! I found this thread in the Unity Forums:
https://answers.unity.com/questions/1760769/help-needed-all-ar-apps-crash-on-startup.html
Looks like it has to do with Google dropping 32 bit support for AR Core in August. You have to change scripting back end to IL2CPP and enable the ARM64 option in the Target Architectures.
My app is working fine again now, hope it fixes it for you too.
do you need ONLY ARM64 or we can mark also ARM7? because it is still crashing for me (if both are turned on).
Your answer
Follow this Question
Related Questions
Blackscreen on Samsung Galaxy S7 when using AR Foundation, Crash when leaving scene 0 Answers
Switching from AR scene to normal unity scene crash using android 0 Answers
How is the game's performance looking on Android? 0 Answers
Unity crash during build with Metaio SDK 1 Answer
Unity 3d Network dies on Android 0 Answers