What I’ve accomplished:
✓ Successfully built MissionPlannerLib.sln for Android
✓ Generated APK/AAB from ExtLibs/Xamarin/Xamarin.Android/Xamarin.Android.csproj
✓ APK installs on device without issues
✓ All native libraries load correctly (libmonosgen, libgdal, libgstreamer_android)
The Problem:
App crashes immediately on startup with:
System.NotSupportedException: TypeConverter cannot convert from System.Byte.
at MissionPlanner.Splash.InitializeComponent () [0x0025e]
at MissionPlanner.Splash..ctor ()
at MissionPlanner.Program.Start (System.String args)
This appears to be Windows Forms .resx resources (likely images/icons) failing to deserialize on Android.
Any guidance on the correct approach to building a working Android APK would be appreciated!
I did a search, do you think is caused by Ensure Proper .NET Framework Installation? you have the correct and fully updated .NET Framework version required by Mission Planner.
I’ve used Mono on Mac where the build was successful and I’ve built the app in windows as well, here are the details:
Get-ChildItem ‘HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP’ -Recurse | Get-ItemProperty -Name version -EA 0 | Where { $_.PSChildName -Match ‘^(?!S)\p{L}’} | Select PSChildName, version
PSChildName Version
v2.0.50727 2.0.50727.4927
v3.0 3.0.30729.4926
Windows Communication Foundation 3.0.4506.4926
Windows Presentation Foundation 3.0.6920.4902
v3.5 3.5.30729.4926
Client 4.8.09221
Full 4.8.09221
Client 4.0.0.0
PS D:\MissionPlanner\ExtLibs\Xamarin\Xamarin.Android\bin\Release> reg query “HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full” /v Release
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full
Release REG_DWORD 0x82405
The main thing is that the build actually succeeds, I successfully generate a 170MB AAB file. The issue occurs at runtime on the Android device. The app crashes immediately with: “System.NotSupportedException: TypeConverter cannot convert from System.Byte” This happens in Splash.InitializeComponent() when it tries to deserialize Windows Forms resources (.resx embedded images/icons).
I’m very confused + I’ve tried multiple times building it and testing it out sometimes ignoring the initialization of splash screen(although knowing it’ll crash again), and some other way like referencing an actual splash screen image(png file) but it still crashes.
any suggestions ? or like what configurations etc I need to keep for a perfect build without any issues ?