Skip to content

[tests] If test suite adds ARM emulator runs in the future, add test for hybrid AOT + armeabi-v7a expected crash #5291

Description

@brendanzagaeski

Context: #4966

After #4966 is merged, builds that attempt to use AndroidAotMode=Hybrid in combination with AndroidSupportedAbis=armeabi-v7a will intentionally fail on a build error to provide a better user experience compared to letting the apps abort on a SIGSEGV (#1218). This error is useful right now, but if hybrid AOT becomes compatible with armeabi-v7a in the future, the error should be removed.

Expected behavior

One way to alert the team if hybrid AOT becomes compatible with armeabi-v7a would be to add a test for it. The problem is that the test needs to run on an armeabi-v7a environment. In the past there were some AOT tests that ran on hardware ARM devices, but those are now deprecated (https://github.com/xamarin/QualityAssurance/commit/62d40bfb933d1ac0af27cf33311c837c4c3efbbc) in favor of tests that can run on emulator.

So if the MSBuildDeviceIntegration test suite is expanded to run tests on ARM emulators in the future, then it would be useful to add a test like the following to the test suite:

[Test]
public void AndroidAotModeHybridAbortsOnArmeabiV7a ()
{
	AssertHasDevices ();

	var proj = new XamarinAndroidApplicationProject () {
		IsRelease = true,
		AotAssemblies = true,
	};
	proj.SetProperty ("AndroidAotMode", "Hybrid");
	proj.SetAndroidSupportedAbis ("armeabi-v7a");
	proj.SetProperty ("_AndroidAotModeValidateAbi", "false");

	builder = CreateApkBuilder ();
	builder.Install (proj);

	ClearAdbLogcat ();
	if (CommercialBuildAvailable)
		Assert.True (builder.RunTarget (proj, "_Run"), "Project should have run.");
	else
		AdbStartActivity ($"{proj.PackageName}/{proj.JavaPackageName}.MainActivity");

	var logcatPath = Path.Combine (Root, builder.ProjectDirectory, "crash-logcat.log");
	Assert.IsTrue (MonitorAdbLogcat ((line) => {
		return line.Contains ($"Force finishing activity {proj.PackageName}");
	}, logcatPath, 30), "Application did not abort within 30 seconds.");
}

Other notes

If support for armeabi-v7a is deprecated before the test suite runs tests on ARM emulators, then this issue should be closed as no longer applicable, and the error from #4966 can be removed.

Similarly, if it turns out that .NET 6 resolves the issue with hybrid AOT or makes larger changes to AOT that make the whole problem obsolete, the issue should be closed, and the error from #4966 can be adjusted so that it only applies to pre-.NET 6 Xamarin.Android projects.

Activity

  1. removed their assignment
    on May 28, 2025
  2. dotnet-policy-service commented on Jun 26, 2026

    @dotnet-policy-service

    We suspect this issue is stale and no longer relevant. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will undo this process.

  3. dotnet-policy-service commented on Jul 11, 2026

    @dotnet-policy-service

    This issue will now be closed since it had been marked "possibly-stale" but received no further activity in the past 14 days. It is still possible to reopen or comment on the issue, but please note that the issue will be locked if it remains inactive for another 30 days.

  4. locked and limited conversation to collaborators on Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

possibly-staleIssues that are potentially no longer relevant.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions