awesome7 / XamAR

Cross-platform Augmented Reality (AR) SDK for Xamarin
https://xamar.io
MIT License
33 stars 6 forks source link

not working in shell application #64

Open chrismaragkos opened 2 years ago

chrismaragkos commented 2 years ago

When I put the ARView in other View than the MainView app crashes when loads the Text renderer, also app crashes when I navigate in other View when View loads. I get this exception when ARView close

System.ObjectDisposedException Message=Cannot access a disposed object. Object name: 'XamAR.UI.Android.Sceneform.Views.XamARFragment'.

Test only in android. Thank you.

miki-bgd commented 2 years ago

Hi, thank you for feedback.

Just to check, you tried putting ArView to MainView and it worked? It crashes only when ArView is on another View?

Thanks

chrismaragkos commented 2 years ago

Hi! Yes in mainview it works but it closes the application when you try to navigate in another View, I make some debug and I'm afraid the problem is in the different versions in android the xamarin new templates are AndroidX so they can't release the arView and arFragment, the app crashes and close. Thank you for you library is great but xamarin with google some times give as a versioning hell :)

miki-bgd commented 2 years ago

This use-case haven't been yet worked on. But it is on our to-do list :)

Actually, problem is little bit different - we are using Sceneform (from Google) for rendering ArView (you can search for ArCoreViewRenderer.cs ). Unfortunatelly, Sceneform was abandoned by Google few years ago, so we are stuck with last version from them (ported to Xamarin) 1.17. (and " Android.Support.V4.App").

However, this doesn't mean that version of Sceneform can't be used in some newer versions of Xamarin.Forms. Some months ago i have used it in a project (Xamarin.Forms ver. "5.0.0.2083"); ArView was displayed in another View, and it performed well.

(My guess is that some couplings are making problems in current version in XamAR, but as i already wrote, we haven't worked on that scenario yet).

PS. Also, if you have feedback (suggestion, criticism, idea...) on parts that work, it would be also appreciated :)

chrismaragkos commented 2 years ago

Thank you Miki for now I will make the current project with OpenGL but I have done fork your repo and when I found time I will give an effort to debug this case with your source code because you have done great job so far and is worth it.

miki-bgd commented 2 years ago

Thank you for your kind words.

when I found time I will give an effort to debug this case with your source code Great, looking forward for your feedback! :)