dotnet/android

java.lang.UnsatisfiedLinkError: No implementation found for void crc64953c68cad4e91ae3.GlmApp.n_OnAppForegrounded() - is the library loaded, e.g. System.loadLibrary?

Opened this issue · 2 comments

gmck commented

Android framework version

net9.0-android

Affected platform version

VS 2022 17.12.0 Prev 1.0

Description

My first try at building and deploying to Android 15. It runs ok in Debug but immediately crashes with the release build.

Apk comparisons net8 32,767kb, net9 36,412kb.

Build_Crash.zip

Steps to Reproduce

N/A

Did you find any workaround?

No

Relevant log output

No response

Please provide a repro project. I don't know what method OnAppForegrounded() is.

Also odd is the stack trace of the runtime crash:

      at crc64953c68cad4e91ae3.GlmApp.OnAppForegrounded(GlmApp.java:43)
      at java.lang.reflect.Method.invoke(Method.java:-2)
      at androidx.lifecycle.ClassesInfoCache$MethodReference.invokeCallback(ClassesInfoCache.java:222)

Why is GLmApp.OnAppForegrounded(), with a Capital O, being invoked from Java? Typically, I would expect Java to be calling an onAppForegrounded() method (lowercase 'o').

My "spider-sense" is that this may be related to marshal methods. Please also try setting $(AndroidEnableMarshalMethods)=False and see if that changes anything.

gmck commented

@jonpryor
Your "spider-sense" is working well. Adding <AndroidEnableMarshalMethods>false</AndroidEnableMarshalMethods> fixed it.

It was when it crashed at start-up.

<AndroidEnableMarshalMethods>true</AndroidEnableMarshalMethods>  
<RuntimeIdentifier>android-arm64</RuntimeIdentifier>

I've now hit another crash when I try to open either of my dashboard fragments. The only difference from all the other fragments is that they are immersive fragments.

Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x234 in tid 26164 (ware.obdnowpros), pid 26164 (ware.obdnowpros)

That crash never makes its way to App Center, so I've got no idea why it crashes there. I got the above from Android Studio's logcat.

Rather than play around with the code in this project, swapping from net8 to net9 and back again. I think I'll create a new net9.0-android35 test app with similar code. Deprecating SetStatusBarColor() in Android 15 seems like a very poor decision. They obviously want every app to look like their boring apps.