Repository navigation
[Xamarin.Android.Build.Tasks] default to only 64-bit targets - #9179
Merged
Merged
Conversation
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
commented
Aug 15, 2024
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> |
Member
Author
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We currently build for all 4 Android architectures by default. While modern apps are more likely to run on
android-arm64modern devices orandroid-x64default emulator on x64 machines.Let's drop 32-bit targets by default, and let customers opt into them. This could significatly help
Releasebuild times, etc.Customers could opt into all 4 by adding in their
.csproj:Or in the case of a multi-targeted .NET MAUI project: