-
Notifications
You must be signed in to change notification settings - Fork 531
Known issues in .NET
$(AndroidEnableMarshalMethods)
is an experimental feature in .NET 8 and .NET 9 Previews.
When using it, Release
builds may fail to fully launch:
- https://github.com/xamarin/xamarin-android/issues/7893
- https://github.com/xamarin/xamarin-android/issues/8253
- https://github.com/xamarin/xamarin-android/pull/7927
A workaround is to remove <AndroidEnableMarshalMethods>true</AndroidEnableMarshalMethods>
in your .csproj
file. Or if your application can target a single architecture: <RuntimeIdentifier>android-arm64</RuntimeIdentifier>
.
We hope to address this in a future .NET 9 release.
This will manifest as a build error like this:
error : The RuntimeIdentifier 'android-arm64' is invalid.
The cause is that by passing -r <runtime identifier>
to 'dotnet build' that runtime identifier is used for all target frameworks in the project file when the project is restored, while it's only a valid runtime identifier for one of the target frameworks.
Potential workaround is to restore manually, and build without restoring:
$ dotnet restore
$ dotnet build --no-restore -f net6.0-android -r android-arm64
This happens with dotnet publish
as well.
This will be fixed in a future version of NuGet.
Ref: https://github.com/dotnet/sdk/issues/21877.
Ref: https://github.com/NuGet/Home/issues/11653.
- APK Tests on the Hyper V Emulator
- Design Time Build System
- Profile MSBuild Tasks
- Diagnose Fast Deployment Issues
- Preview layout XML files with Android Studio
- Documentation