AR Scene crashes on start after loading the scene successfully multiple times.
Hello, first post so sorry in advance if I don't provide the correct info.
I am building an AR app in Unity 2019.2.12 with AR Kit XR Plugin 2.0.1
When the AR scene starts for the first time after the app is launched there is no problems. Ill mess around in the scene for a while then exit to the main menu. When I relaunch the AR scene sometimes the app works fine but other times it will crash. If I repeat, eventually the app will crash. I am using the GenerateImageAnchor script that is built in to the AR Kit Plugin, and just before the crash the concole log looks like this:
At Main Menu
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
Unloading 0 Unused Serialized files (Serialized files now loaded: 0)
Unloading 0 unused Assets to reduce memory usage. Loaded Objects now: 2099.
Total: 2.218375 ms (FindLiveObjects: 0.413500 ms CreateObjectMapping: 0.051458 ms MarkObjects: 1.736500 ms DeleteObjects: 0.016208 ms)
Unloading 0 Unused Serialized files (Serialized files now loaded: 0)
UnloadTime: 4.050333 ms
Unloading 14 unused Assets to reduce memory usage. Loaded Objects now: 1490.
Total: 2.310542 ms (FindLiveObjects: 0.606792 ms CreateObjectMapping: 0.116208 ms MarkObjects: 1.438542 ms DeleteObjects: 0.147875 ms)
Unloading 1 Unused Serialized files (Serialized files now loaded: 0)
UnloadTime: 1.055167 ms
Unloading 3 unused Assets to reduce memory usage. Loaded Objects now: 3764.
Total: 2.345167 ms (FindLiveObjects: 0.656542 ms CreateObjectMapping: 0.130583 ms MarkObjects: 1.493292 ms DeleteObjects: 0.063917 ms)
Here
UnityARCameraManager:Start()
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
Unloading 0 Unused Serialized files (Serialized files now loaded: 0)
Unloading 0 unused Assets to reduce memory usage. Loaded Objects now: 3768.
Total: 394.957833 ms (FindLiveObjects: 1.407583 ms CreateObjectMapping: 0.270208 ms MarkObjects: 393.252292 ms DeleteObjects: 0.026958 ms)
image anchor removed[304879A4-ED35-3BB2-124A-A65E3A23B0CF] : tracked => True
GenerateImageAnchor:RemoveImageAnchor(ARImageAnchor)
UnityEngine.XR.iOS.ARImageAnchorRemoved:Invoke(ARImageAnchor)
UnityEngine.XR.iOS.UnityARSessionNativeInterface:_image_anchor_removed(UnityARImageAnchorData)
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
image anchor removed[304879A4-ED35-3BB2-124A-A65E3A23B0CF] : tracked => True
GenerateImageAnchor:RemoveImageAnchor(ARImageAnchor)
UnityEngine.XR.iOS.ARImageAnchorRemoved:Invoke(ARImageAnchor)
UnityEngine.XR.iOS.UnityARSessionNativeInterface:_image_anchor_removed(UnityARImageAnchorData)
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
image anchor removed[304879A4-ED35-3BB2-124A-A65E3A23B0CF] : tracked => True
GenerateImageAnchor:RemoveImageAnchor(ARImageAnchor)
UnityEngine.XR.iOS.ARImageAnchorRemoved:Invoke(ARImageAnchor)
UnityEngine.XR.iOS.UnityARSessionNativeInterface:_image_anchor_removed(UnityARImageAnchorData)
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
image anchor removed[304879A4-ED35-3BB2-124A-A65E3A23B0CF] : tracked => True
GenerateImageAnchor:RemoveImageAnchor(ARImageAnchor)
UnityEngine.XR.iOS.ARImageAnchorRemoved:Invoke(ARImageAnchor)
UnityEngine.XR.iOS.UnityARSessionNativeInterface:_image_anchor_removed(UnityARImageAnchorData)
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
image anchor removed[304879A4-ED35-3BB2-124A-A65E3A23B0CF] : tracked => True
GenerateImageAnchor:RemoveImageAnchor(ARImageAnchor)
UnityEngine.XR.iOS.ARImageAnchorRemoved:Invoke(ARImageAnchor)
UnityEngine.XR.iOS.UnityARSessionNativeInterface:_image_anchor_removed(UnityARImageAnchorData)
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
image anchor removed[304879A4-ED35-3BB2-124A-A65E3A23B0CF] : tracked => True
GenerateImageAnchor:RemoveImageAnchor(ARImageAnchor)
UnityEngine.XR.iOS.ARImageAnchorRemoved:Invoke(ARImageAnchor)
UnityEngine.XR.iOS.UnityARSessionNativeInterface:_image_anchor_removed(UnityARImageAnchorData)
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
libc++abi.dylib: terminating with uncaught exception of type Il2CppExceptionWrapper
(lldb)
Seems like the GenerateImageAnchor Script is trying to remove an image anchor even though I just loaded the scene and there shouldn't be any active.
Been stuck on this for a few days and would love any help. Thanks.
Answer by joeysipos · Jun 25, 2020 at 08:53 PM
I have been running into the same issue with the app sporadically crashing. Did you figure anything out?
Your answer
![](https://koobas.hobune.stream/wayback/20220612233027im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Unity iOS - Wont compile in Xcode 2 Answers
expected unqualified id on libiconv.2.tbd 0 Answers
How to add shadows for multiple 3D models in native arkit ios 0 Answers
Crazy high RAM usage on IOS 0 Answers