After updating .NET MAUI project from .NET 8 to .NET 9, when I try to build and deploy Android app in Emulator, build process shows "Deployed" and then as soon as splash screen appears, I get this error
System.NotSupportedException: Unable to find Invoker for type 'Microsoft.Maui.MauiApplication'. Was it linked away?
Here is a screenshot of the error:
This is what I have tried until now, but no luck
Clean project and then re-build
Delete obj/bin project and then re-build
Updated Nuget packages
Checked that I have properly installed .NET 9 SDK, Android Emulator with api 35
Updated AndroidManifest.xml
<uses-sdk android:minSdkVersion="35" android:targetSdkVersion="35" />
How to resolve this error?
In my case, enabling Fast Deployment fixed this error.
Project>Property>Android>Option>Fast Deployment
Reference: https://github.com/dotnet/maui/issues/29941