Edit

.NET for Android error XA4227

Example messages

error XA4227: Architecture 'x86' doesn't match all marshal methods in architecture 'arm64-v8a'. Please see detailed MSBuild logs for more information.

Issue

When building for multiple Android architectures, the marshal methods generated for each architecture must be consistent. This error means one architecture has marshal methods that do not match those of the template (first) architecture.

Solution

Ensure that all target architectures reference the same set of managed types and methods. Enable detailed MSBuild logging (-v:diag) to see exactly which marshal methods differ, then adjust the project so that all architectures produce the same set of marshal methods.