Select to view content in your preferred language

3D object from Mobile Scene Package disappear in Android

412
14
Jump to solution
11-08-2024 02:02 AM
Labels (2)
Marco_Foi
Emerging Contributor

I am building a MAUI app on .NET 8 using Esri.ArcGISRuntime.Maui 200.5.0

I created a Mobile Scene Package file in ArcGIS Pro and embedded it in the app as a Resource.

I created TWO version of the file: one WITH end one WITHOUT "Reference online content"

reference online content.png

If I use the one WITH BASEMAP get the expected result in Windows BUT NOT in Android (14):

WINDOWS: windows_with_basemap.png

ANDROID 14: android_with_basemap.png

Sometimes, at start, the 3D model appeard but is somehow "wiped out" by the basemap drawing event 

If I use the one WITHOUT I get the expected result both in Android (14) and Windows:

WINDOWS:windows_no_basemaps.png

ANDROID: android_no_basemaps.png

All this tells me there is no issue with my data.. ..and it looks like a Runtime BUG.

Is it?

(I am attaching the two MobileScenePackage .mspk files)

0 Kudos
14 Replies
Marco_Foi
Emerging Contributor

There is NO WAY to use 

Esri.ArcGISRuntime.Android

in a Esri.ArcGISRuntime.MAUI application.

0 Kudos
dotMorten_esri
Esri Notable Contributor

There property is in the namespace: `Esri.ArcGISRuntime.Controls.UI.SceneView`
Make sure you place the code inside an #if __ANDROID__ section since the specific property is only available on the Android target.

0 Kudos
Marco_Foi
Emerging Contributor

Can you please elaborate HOW to access that property in MAUI application?


I am currently setting this dependency in my project file:
<PackageReference Include="Esri.ArcGISRuntime.Maui" Version="200.6.0" />
Also I am defining the current namespace in my ContentPage XML
xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013"

All this has worked well so far.. ..but does not give me access to the property you quoted : `Esri.ArcGISRuntime.Controls.UI.SceneView` 

nor the one you probably intended to quote 😉

`Esri.ArcGISRuntime.UI.Controls.SceneView`

Do I need to install other dependencies beside Esri.ArcGISRuntime.Maui?

0 Kudos
dotMorten_esri
Esri Notable Contributor

The maui dependency will automatically include the dependencies that gives you access to this. Here's a bit of code I was able to write in a blank maui app that adds just the Esri.ArcGISRuntime.Maui package:

 

dotMorten_esri_0-1734629379523.png

 

0 Kudos
Marco_Foi
Emerging Contributor

I can confirm that the issue of "disappearing MultiPatch" (MultiPatch loaded Mobile Scene Packages into SceneView in MAUI Android application) can be fixed increaseing the RAM avaialble to the Object.

This can be done inside the MapuiProgram.cs file, by adding the following line at bottom of CreateMauiApp() method:

 

#if ANDROID
    // Increase memory available to SceneView
    Esri.ArcGISRuntime.UI.Controls.SceneView.MemoryLimit = 4294967296;
#endif

 

Note #1: the MemoryLimit of 4294967296bytes is 4GB and is FOUR times the default value of 1073741824 bytes (1GB) that is assigned on Tablets having at least 6-8Gb of RAM.
Note #2: A value of 2 or 3Gb might be enough to fix the issue but this was not tested. 

 

0 Kudos