Problem
The SetAndroidSupportedAbis extension methods in ProjectExtensions.cs are marked [Obsolete] with the message "please use SetRuntimeIdentifiers instead." There are ~49 call sites across 16 test files still using the deprecated API, generating compiler warnings.
Location
- Definition:
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Utilities/ProjectExtensions.cs (lines 15-29)
- Callers in
src/.../Tests/Xamarin.Android.Build.Tests/:
EnvironmentContentTests.cs (4 calls)
IncrementalBuildTest.cs (4 calls)
AotTests.cs (3 calls)
BuildTest.cs (2 calls)
BuildTest2.cs (1 call)
PackagingTest.cs (2 calls)
ManifestTest.cs (1 call)
Tasks/LinkerTests.cs (1 call)
- Callers in
tests/MSBuildDeviceIntegration/Tests/:
InstallAndRunTests.cs (12 calls)
InstallTests.cs (9 calls)
DebuggingTest.cs (3 calls)
MonoAndroidExportTest.cs (2 calls)
BundleToolTests.cs (1 call)
PerformanceTest.cs (1 call)
SystemApplicationTests.cs (1 call)
MarshalMethodsGCHangTests.cs (1 call)
AotProfileTests.cs (1 call)
Current Code
// Definition in ProjectExtensions.cs
[Obsolete ("SetAndroidSupportedAbis is deprecated, please use SetRuntimeIdentifiers instead.")]
public static void SetAndroidSupportedAbis (this IShortFormProject project, params string [] abis)
{
project.SetRuntimeIdentifiers (abis);
}
[Obsolete ("SetAndroidSupportedAbis is deprecated, please use SetRuntimeIdentifiers instead.")]
public static void SetAndroidSupportedAbis (this IShortFormProject project, string abis)
{
project.SetRuntimeIdentifiers (abis.Split (';'));
}
// Typical usage in tests:
proj.SetAndroidSupportedAbis ("armeabi-v7a;arm64-v8a");
app.SetAndroidSupportedAbis ("arm64-v8a");
Suggested Fix
Replace all calls to SetAndroidSupportedAbis with SetRuntimeIdentifiers:
// Single ABI (string overload) - before:
app.SetAndroidSupportedAbis ("arm64-v8a");
// After:
app.SetRuntimeIdentifiers (new[] { "arm64-v8a" });
// Multiple ABIs (semicolon-separated string overload) - before:
proj.SetAndroidSupportedAbis ("armeabi-v7a;arm64-v8a");
// After:
proj.SetRuntimeIdentifiers (new[] { "armeabi-v7a", "arm64-v8a" });
// Params overload - before:
proj.SetAndroidSupportedAbis ("arm64-v8a", "x86_64");
// After:
proj.SetRuntimeIdentifiers (new[] { "arm64-v8a", "x86_64" });
After all callers are migrated, remove both SetAndroidSupportedAbis overloads from ProjectExtensions.cs.
Guidelines
SetRuntimeIdentifiers(IEnumerable<string> androidAbis) accepts ABI names (e.g., "arm64-v8a") and internally converts them to RIDs using AbiUtils.AbiToRuntimeIdentifier
- Don't change any test logic, assertions, or behavior — only the method call
- Use
new[] { ... } syntax for the array argument (not new string[] { ... })
- Follow existing code style: spaces before
( and [
Acceptance Criteria
Generated by Nightly Fix Finder for issue #11352 · ● 3.4M · ◷
Problem
The
SetAndroidSupportedAbisextension methods inProjectExtensions.csare marked[Obsolete]with the message "please use SetRuntimeIdentifiers instead." There are ~49 call sites across 16 test files still using the deprecated API, generating compiler warnings.Location
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Utilities/ProjectExtensions.cs(lines 15-29)src/.../Tests/Xamarin.Android.Build.Tests/:EnvironmentContentTests.cs(4 calls)IncrementalBuildTest.cs(4 calls)AotTests.cs(3 calls)BuildTest.cs(2 calls)BuildTest2.cs(1 call)PackagingTest.cs(2 calls)ManifestTest.cs(1 call)Tasks/LinkerTests.cs(1 call)tests/MSBuildDeviceIntegration/Tests/:InstallAndRunTests.cs(12 calls)InstallTests.cs(9 calls)DebuggingTest.cs(3 calls)MonoAndroidExportTest.cs(2 calls)BundleToolTests.cs(1 call)PerformanceTest.cs(1 call)SystemApplicationTests.cs(1 call)MarshalMethodsGCHangTests.cs(1 call)AotProfileTests.cs(1 call)Current Code
Suggested Fix
Replace all calls to
SetAndroidSupportedAbiswithSetRuntimeIdentifiers:After all callers are migrated, remove both
SetAndroidSupportedAbisoverloads fromProjectExtensions.cs.Guidelines
SetRuntimeIdentifiers(IEnumerable<string> androidAbis)accepts ABI names (e.g.,"arm64-v8a") and internally converts them to RIDs usingAbiUtils.AbiToRuntimeIdentifiernew[] { ... }syntax for the array argument (notnew string[] { ... })(and[Acceptance Criteria
SetAndroidSupportedAbistoSetRuntimeIdentifiers[Obsolete]SetAndroidSupportedAbisoverloads removed fromProjectExtensions.csCS0618warnings remain forSetAndroidSupportedAbis