Select to view content in your preferred language

Android Maui app crashing on Xiaomi Redmi 9AT at builder.UseArcGISRuntime()

120
1
3 weeks ago
Labels (3)
JochemtHart
New Contributor

Hi, I've run into a problem where our app is running accross multiple devices, however it crashes at startup on a Xiaomi Redmi 9AT, Android 10, API 29. I have been able to track the crash to the MauiProgram.cs at builder.UseArcGISRuntime() and it only crashes on the ArcGISRuntime SDK version 200.5 and onwards.

Below are the code where the crash happens (line 4) and the Device Log (logcat)

 

var builder = MauiApp.CreateBuilder();
builder
    .UseMauiApp<App>()
    .UseArcGISRuntime()
    .ConfigureFonts(fonts =>
    {
        fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
        fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
    });
Time	Device Name	Type	PID	Tag	Message
12-03 17:11:55.081	Xiaomi M2006C3LVG	Error	29988	AndroidRuntime	android.runtime.JavaProxyThrowable: System.InvalidProgramException: Invalid IL due to: method RuntimeCoreNet.GeneratedWrappers.CoreArcGISRuntimeEnvironment:OnPrivateArcGISRuntimeEnvironment_ArcadeConsoleMessage (intptr,intptr,RuntimeCoreNet.GeneratedWrappers.CoreInteropString) with UnmanagedCallersOnlyAttribute has non-blittable parameters or return type assembly:<unknown assembly> type:<unknown type> member:(null)
   at RuntimeCoreNet.GeneratedWrappers.CoreArcGISRuntimeEnvironment.SetArcadeConsoleMessageCallback(CoreArcadeConsole_MessageReceived )
   at Esri.ArcGISRuntime.ArcGISRuntimeEnvironment.InitializeRuntimeCore()
   at Esri.ArcGISRuntime.ArcGISRuntimeEnvironment.Initialize(Action`1 )
   at Esri.ArcGISRuntime.Maui.AppHostBuilderExtensions.UseArcGISRuntime(MauiAppBuilder builder, Action`1 configure)
   at Esri.ArcGISRuntime.Maui.AppHostBuilderExtensions.UseArcGISRuntime(MauiAppBuilder builder)
   at MauiAppXiaomiTest.MauiProgram.CreateMauiApp()
   at MauiAppXiaomiTest.MainApplication.CreateMauiApp()
   at Microsoft.Maui.MauiApplication.OnCreate()
   at Android.App.Application.n_OnCreate(IntPtr jnienv, IntPtr native__this)
   at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PP_V(_JniMarshal_PP_V callback, IntPtr jnienv, IntPtr klazz)
	at crc6488302ad6e9e4df1a.MauiApplication.n_onCreate(Native Method)
	at crc6488302ad6e9e4df1a.MauiApplication.onCreate(MauiApplication.java:28)
	at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1189)
	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6603)
	at android.app.ActivityThread.access$1500(ActivityThread.java:235)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1916)
	at android.os.Handler.dispatchMessage(Handler.java:107)
	at android.os.Looper.loop(Looper.java:225)
	at android.app.ActivityThread.main(ActivityThread.java:7563)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:994)

 

We unfortunately cannot go back to the SDK version 200.4, because version 200.5 fixed a breaking issue for us where the map would turn blank when the app had been running in the background for a while.

Reproduction

  1. Create a blank (Hello world) Maui app and add the ArcGISRuntime SDK version 200.6
  2. Add .UseArcGISRuntime() to the MauiApp builder
  3. Set configuration to Release. The crash does not happen in debug mode.
  4. Launch the app on a local Xiaomi Redmi 9AT (Android 10, API 29) device.

Running the app on a Pixel 5 Android 10 API 29 emulator device does not result in a crash.

Running the app on the Xiaomi Redmi 9AT with ArcGISRuntime SDK version 200.4 does also not result in a crash.

I have not been able to test the app on other Xiaomi devices or other Android 10 API 29 devices.

 

If there any remaining questions, please let me know.

 

 

0 Kudos
1 Reply
dotMorten_esri
Esri Notable Contributor

We've recently been made aware of a regression with older 32bit Android Armv7 devices and are still investigating, and it appears you're likely also hitting this. We're still trying to fully determine if this is an issue in the .NET runtime or the Maps SDK (it was introduced in 200.5, because of some newer code hitting this .NET bug).

0 Kudos