Skip to content

[Xamarin.Android.Build.Tasks] default to only 64-bit targets - #9179

Merged
jonpryor merged 5 commits into
dotnet:mainfrom
jonathanpeppers:drop-32-by-default
Aug 16, 2024
Merged

jonpryor merged 5 commits into
dotnet:mainfrom
jonathanpeppers:drop-32-by-default

Conversation

@jonathanpeppers

Copy link
Copy Markdown
Member

We currently build for all 4 Android architectures by default. While modern apps are more likely to run on android-arm64 modern devices or android-x64 default emulator on x64 machines.

Let's drop 32-bit targets by default, and let customers opt into them. This could significatly help Release build times, etc.

Customers could opt into all 4 by adding in their .csproj:

<RuntimeIdentifiers>android-arm;android-arm64;android-x86;android-x64</RuntimeIdentifiers>

Or in the case of a multi-targeted .NET MAUI project:

<RuntimeIdentifiers Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">android-arm;android-arm64;android-x86;android-x64</RuntimeIdentifiers>

We currently build for all 4 Android architectures by default. While
modern apps are more likely to run on `android-arm64` modern devices
or `android-x64` default emulator on x64 machines.

Let's drop 32-bit targets by default, and let customers opt into them.
This could significatly help `Release` build times, etc.

Customers could opt into all 4 by adding in their `.csproj`:

    <RuntimeIdentifiers>android-arm;android-arm64;android-x86;android-x64</RuntimeIdentifiers>

Or in the case of a multi-targeted .NET MAUI project:

    <RuntimeIdentifiers Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">android-arm;android-arm64;android-x86;android-x64</RuntimeIdentifiers>
@jonathanpeppers
jonathanpeppers marked this pull request as ready for review August 15, 2024 19:47
Comment on lines -285 to -292
<Target Name=""_CheckAbis"" BeforeTargets=""_DefineBuildTargetAbis"">
<PropertyGroup>
<AndroidSupportedAbis>armeabi-v7a;x86</AndroidSupportedAbis>
<AndroidSupportedAbis Condition=""Exists('$(MSBuildThisFileDirectory)..\..\..\..\Debug\lib\xamarin.android\xbuild\Xamarin\Android\lib\arm64-v8a\libmono-android.release.so')"">$(AndroidSupportedAbis);arm64-v8a</AndroidSupportedAbis>
<AndroidSupportedAbis Condition=""Exists('$(MSBuildThisFileDirectory)..\..\..\..\Debug\lib\xamarin.android\xbuild\Xamarin\Android\lib\x86_64\libmono-android.release.so')"">$(AndroidSupportedAbis);x86_64</AndroidSupportedAbis>
</PropertyGroup>
<Message Text=""$(AndroidSupportedAbis)"" />
</Target>

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is really old. It detected when we used to only build some of the ABIs on PRs. Think we can just remove this now.

@jonpryor
jonpryor merged commit 6be8531 into dotnet:main Aug 16, 2024
@jonathanpeppers
jonathanpeppers deleted the drop-32-by-default branch August 16, 2024 19:18
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants