You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whenever a .NET SDK for Android app starts, MonoVM will probe for a
number of Mono components:
I monodroid-assembly: Trying to load shared library '/data/app/~~5lwn5C40pkRva2-L4kilZA==/com.microsoft.net6.helloandroid-MrYUTOqX7yZPkmtLOPnuuw==/split_config.arm64_v8a.apk!/lib/arm64-v8a/libmono-component-debugger.so'
I monodroid-assembly: Failed to load shared library '/data/app/~~5lwn5C40pkRva2-L4kilZA==/com.microsoft.net6.helloandroid-MrYUTOqX7yZPkmtLOPnuuw==/split_config.arm64_v8a.apk!/lib/arm64-v8a/libmono-component-debugger.so'.
dlopen failed: library "/data/app/~~5lwn5C40pkRva2-L4kilZA==/com.microsoft.net6.helloandroid-MrYUTOqX7yZPkmtLOPnuuw==/split_config.arm64_v8a.apk!/lib/arm64-v8a/libmono-component-debugger.so" not found
The above is repeated for, currently, 3 components. Together, the
failed load attempts cost us around 1ms of startup time on Pixel 3 XL;
the time will depend on the speed of device's storage and CPU.
Since we know at the build time which components are included, we can
optimize the startup process by recording a flag indicating which
components can be loaded successfully.
Add a `mono_components_mask` field to `ApplicationConfig` which is set
to a bitmask indicating which components are packaged. On application
startup, whenever `monodroid_dlopen` is called, we has the name of the
library passed to us by Mono and see if it matches one of the known
hashes for the various components. If yes, we consult the mask stored
at build time and attempt to load the component only if its bit is set.
The above check is performed **only** during application startup since
that's when Mono probes for the components and it would be a waste of
time later in the application life.
0 commit comments