Forum Xamarin.Android

Crash with System.DllNotFoundException: on a single device in Firebasey test lab

I have a Xamarin Forms app built with App Center and pushed to the Play Store. For at least a week the pre-launch report has failed on a specific device (Huawei P8 Lite - Android 5.0) with the following error:

Process: net.gameswithgravitas.tictactoe, PID: 19258
android.runtime.JavaProxyThrowable: System.TypeInitializationException: The type initializer for 'AndroidTimeZones' threw an exception. ---> System.DllNotFoundException:
  at (wrapper managed-to-native) Interop+Sys.Stat(byte&,Interop/Sys/FileStatus&)
  at Interop+Sys.Stat (System.ReadOnlySpan`1[T] path, Interop+Sys+FileStatus& output) [0x00028] in <500cec83919e4287bff01b35e8a7fe03>:0 
  at System.IO.FileSystem.FileExists (System.ReadOnlySpan`1[T] fullPath, System.Int32 fileType, Interop+ErrorInfo& errorInfo) [0x00007] in <500cec83919e4287bff01b35e8a7fe03>:0 
  at System.IO.FileSystem.FileExists (System.ReadOnlySpan`1[T] fullPath) [0x00006] in <500cec83919e4287bff01b35e8a7fe03>:0 
  at System.IO.File.Exists (System.String path) [0x00043] in <500cec83919e4287bff01b35e8a7fe03>:0 
  at System.TimeZoneInfo+AndroidTimeZones.GetDefaultTimeZoneDB () [0x0000a] in <500cec83919e4287bff01b35e8a7fe03>:0 
  at System.TimeZoneInfo+AndroidTimeZones..cctor () [0x00000] in <500cec83919e4287bff01b35e8a7fe03>:0 
   --- End of inner exception stack trace ---

A search on the internet for System.DllNotFoundException: suggests it's normally caused by a version mismatch between the app and the shared Mono runtime on the device. In this case, it's a release build that is not using the shared runtime, and also works fine on other devices.

Has any one else had a similar issue with pre-launch reports? Or has any other idea?

It seems there could be some left over Mono shared runtime on the specific device Firebase uses (I have no idea what their test lab does underneath), or something wrong with Xamarin on Huawei P8 Lites in general (but that seems unlikely).


  • OliverBrownOliverBrown GBBeta ✭✭

    An update:

    I just downloaded an older APK from the Play Store artifacts section that passed the pre-launch report and manually ran a Robo test using Firebase Test Lab (which is the same system the pre launch report uses) on a P8 Lite and it had the error.

    However, that pre-launch report it originally ran did not include a P8 Lite so I'm not sure what it proves.

  • OliverBrownOliverBrown GBBeta ✭✭

    Another (possibly final update):

    Changing the SDK version on App Center from Xamarin Android 9.4/Mono 6.0 to Xamarin Android 10/Mono 6.4 seems to produce builds that work.

  • Same problem here. Swichting to target android 10 does not fix it for me.
    Huawei P8 Lite - Android 5.0 is the only failing device in the pre-launch report.
    Cannot reproduce it locally but I do no have acces to a Arm64 device with android 5.0

Sign In or Register to comment.