Start a new topic

Wikitude 5.1.1 Xamarin component crash on reload

Wikitude 5.1.1 Xamarin component crash on reload


Hello,

We currently use Wikitude 5.1.1 component for Xamarin iOS for augmented reality experience with 3d models on location.

The Augmented Reality page loads correctly at the first time. When the user restarts the page (go to previous and opens again the Augmented Reality page) the app crashes with:


Check failed: !IsGoogleLoggingInitialized() You called InitGoogleLogging() twice!


The only answer that might have to do with that is in this link https://support.wikitude.com/support/search/topics?term=Wikitude+SDK+5+issues and specifically:



The reason oftentimes is a retain cycle because the WTArchitectView or WTWikitudeNativeSDK object is strongly referenced in a block. Simply create a weak pointer to your Wikitude SDK object and use this weak pointer inside the block.



We approach our app only from Xamarin perspective with C# so I don't currently know exactly how to implement this in our app. How can I solve this and place a weak reference to Wikitude 5.1.1 component for Xamarin?

 

Any ideas/suggestions?

 

Thank you in advance!!

Hello,

Can you direct me to a thread that has this solution?

I tried architectView.Dispose () and architectView.RemoveFromSuperview () but when the page is loading again the app crashes anyways. Any ideas how to implement it with Xamarin and C#?

For iOS native solutions, the answers are too ambiguous.

I am attaching the error screenshot.

Thank you for your quick answer.

Hi Panagiotis,
This was answered in a different thread of our Forum and the quick summary is to remove the ArchitectView from the view hierarchy and calling the dispose() method of it to force it's destruction.

Best regards

Andreas

Hi Panagiotis,
This is the thread I was refering to:

RE: IOS app crashes when starting AR

Can you keep me up to date if that worked for you? thx!

Best regards

Andreas

Hello,

I had not see the thread you mentioned but I have found the solution, which basically is similar to it.


At ViewWillAppear() we create our architectView and give our View's Bounds. Then we set license and start our architectView.

At ViewDidDisappear() we set architectView to stop(), then removeFromSuperview(), dispose() and set to null (just to be sure).


So, every time the page is loaded the architectView is set from the beginning and when the user loads the next or the previous page, architectView is basically disposed entirely.

Thank you for your answer! This question is officially answered.
Login or Signup to post a comment