diff --git a/src/Microsoft.Android.Run/AdbHelper.cs b/src/Microsoft.Android.Run/AdbHelper.cs new file mode 100644 index 00000000000..b34656a9563 --- /dev/null +++ b/src/Microsoft.Android.Run/AdbHelper.cs @@ -0,0 +1,32 @@ +using System.Diagnostics; +using Xamarin.Android.Tools; + +static class AdbHelper +{ + public static ProcessStartInfo CreateStartInfo (string adbPath, string? adbTarget, string arguments) + { + var fullArguments = string.IsNullOrEmpty (adbTarget) ? arguments : $"{adbTarget} {arguments}"; + return new ProcessStartInfo { + FileName = adbPath, + Arguments = fullArguments, + UseShellExecute = false, + RedirectStandardOutput = true, + RedirectStandardError = true, + CreateNoWindow = true, + }; + } + + public static async Task<(int ExitCode, string Output, string Error)> RunAsync (string adbPath, string? adbTarget, string arguments, CancellationToken cancellationToken, bool verbose = false) + { + var psi = CreateStartInfo (adbPath, adbTarget, arguments); + + if (verbose) + Console.WriteLine ($"Running: adb {psi.Arguments}"); + + using var stdout = new StringWriter (); + using var stderr = new StringWriter (); + var exitCode = await ProcessUtils.StartProcess (psi, stdout, stderr, cancellationToken); + + return (exitCode, stdout.ToString (), stderr.ToString ()); + } +} diff --git a/src/Microsoft.Android.Run/Program.cs b/src/Microsoft.Android.Run/Program.cs index 6eda1c6020b..15bde91cf55 100644 --- a/src/Microsoft.Android.Run/Program.cs +++ b/src/Microsoft.Android.Run/Program.cs @@ -10,6 +10,7 @@ string? package = null; string? activity = null; string? deviceUserId = null; +string? instrumentation = null; bool verbose = false; int? logcatPid = null; Process? logcatProcess = null; @@ -17,7 +18,7 @@ string? logcatArgs = null; try { - return Run (args); + return await RunAsync (args); } catch (Exception ex) { Console.Error.WriteLine ($"Error: {ex.Message}"); if (verbose) @@ -25,7 +26,7 @@ return 1; } -int Run (string[] args) +async Task RunAsync (string[] args) { bool showHelp = false; bool showVersion = false; @@ -47,11 +48,15 @@ int Run (string[] args) "The Android application {PACKAGE} name (e.g., com.example.myapp). Required.", v => package = v }, { "c|activity=", - "The {ACTIVITY} class name to launch. Required.", + "The {ACTIVITY} class name to launch. Required unless --instrument is used.", v => activity = v }, { "user=", "The Android device {USER_ID} to launch the activity under (e.g., 10 for a work profile).", v => deviceUserId = v }, + { "i|instrument=", + "The instrumentation {RUNNER} class name (e.g., com.example.myapp.TestInstrumentation). " + + "When specified, runs 'am instrument' instead of 'am start'.", + v => instrumentation = v }, { "v|verbose", "Enable verbose output for debugging.", v => verbose = v != null }, @@ -95,9 +100,9 @@ int Run (string[] args) options.WriteOptionDescriptions (Console.Out); Console.WriteLine (); Console.WriteLine ("Examples:"); - Console.WriteLine ($" {Name} -p com.example.myapp"); Console.WriteLine ($" {Name} -p com.example.myapp -c com.example.myapp.MainActivity"); - Console.WriteLine ($" {Name} --adb /path/to/adb -p com.example.myapp"); + Console.WriteLine ($" {Name} -p com.example.myapp -i com.example.myapp.TestInstrumentation"); + Console.WriteLine ($" {Name} --adb /path/to/adb -p com.example.myapp -c com.example.myapp.MainActivity"); Console.WriteLine (); Console.WriteLine ("Press Ctrl+C while running to stop the Android application and exit."); return 0; @@ -109,8 +114,16 @@ int Run (string[] args) return 1; } - if (string.IsNullOrEmpty (activity)) { - Console.Error.WriteLine ("Error: --activity is required."); + bool isInstrumentMode = !string.IsNullOrEmpty (instrumentation); + + if (!isInstrumentMode && string.IsNullOrEmpty (activity)) { + Console.Error.WriteLine ("Error: --activity or --instrument is required."); + Console.Error.WriteLine ($"Try '{Name} --help' for more information."); + return 1; + } + + if (isInstrumentMode && !string.IsNullOrEmpty (activity)) { + Console.Error.WriteLine ("Error: --activity and --instrument cannot be used together."); Console.Error.WriteLine ($"Try '{Name} --help' for more information."); return 1; } @@ -129,6 +142,8 @@ int Run (string[] args) return 1; } + Debug.Assert (adbPath != null, "adbPath should be non-null after validation"); + if (verbose) { Console.WriteLine ($"Using adb: {adbPath}"); if (!string.IsNullOrEmpty (adbTarget)) @@ -136,13 +151,18 @@ int Run (string[] args) Console.WriteLine ($"Package: {package}"); if (!string.IsNullOrEmpty (activity)) Console.WriteLine ($"Activity: {activity}"); + if (isInstrumentMode) + Console.WriteLine ($"Instrumentation runner: {instrumentation}"); } // Set up Ctrl+C handler Console.CancelKeyPress += OnCancelKeyPress; try { - return RunApp (); + if (isInstrumentMode) + return await RunInstrumentationAsync (); + + return await RunAppAsync (); } finally { Console.CancelKeyPress -= OnCancelKeyPress; cts.Dispose (); @@ -157,8 +177,8 @@ void OnCancelKeyPress (object? sender, ConsoleCancelEventArgs e) cts.Cancel (); - // Force-stop the app - StopApp (); + // Force-stop the app (fire-and-forget in cancel handler) + _ = StopAppAsync (); // Kill logcat process if running try { @@ -171,14 +191,91 @@ void OnCancelKeyPress (object? sender, ConsoleCancelEventArgs e) } } -int RunApp () +async Task RunInstrumentationAsync () +{ + // Build the am instrument command + var userArg = string.IsNullOrEmpty (deviceUserId) ? "" : $" --user {deviceUserId}"; + var cmdArgs = $"shell am instrument -w{userArg} {package}/{instrumentation}"; + + if (verbose) + Console.WriteLine ($"Running instrumentation: adb {cmdArgs}"); + + // Run instrumentation with streaming output + var psi = AdbHelper.CreateStartInfo (adbPath, adbTarget, cmdArgs); + using var instrumentProcess = new Process { StartInfo = psi }; + + var locker = new Lock (); + + instrumentProcess.OutputDataReceived += (s, e) => { + if (e.Data != null) + lock (locker) + Console.WriteLine (e.Data); + }; + + instrumentProcess.ErrorDataReceived += (s, e) => { + if (e.Data != null) + lock (locker) + Console.Error.WriteLine (e.Data); + }; + + instrumentProcess.Start (); + instrumentProcess.BeginOutputReadLine (); + instrumentProcess.BeginErrorReadLine (); + + // Also start logcat in the background for additional debug output + logcatPid = await GetAppPidAsync (); + if (logcatPid != null) + StartLogcat (); + + // Wait for instrumentation to complete or Ctrl+C + try { + while (!instrumentProcess.HasExited && !cts.Token.IsCancellationRequested) { + try { + await Task.Delay (250, cts.Token); + } catch (OperationCanceledException) { + break; + } + } + + if (cts.Token.IsCancellationRequested) { + try { instrumentProcess.Kill (); } catch (Exception ex) { + if (verbose) + Console.Error.WriteLine ($"Cleanup: {ex.Message}"); + } + return 1; + } + + instrumentProcess.WaitForExit (); + } finally { + // Clean up logcat + try { + if (logcatProcess != null && !logcatProcess.HasExited) { + logcatProcess.Kill (); + logcatProcess.WaitForExit (1000); + } + } catch (Exception ex) { + if (verbose) + Console.Error.WriteLine ($"Logcat cleanup: {ex.Message}"); + } + } + + // Check exit status + if (instrumentProcess.ExitCode != 0) { + Console.Error.WriteLine ($"Error: adb instrument exited with code {instrumentProcess.ExitCode}"); + return 1; + } + + return 0; +} + +async Task RunAppAsync () { // 1. Start the app - if (!StartApp ()) + if (!await StartAppAsync ()) return 1; // 2. Get the PID - logcatPid = GetAppPid (); + logcatPid = await GetAppPidAsync (); if (logcatPid == null) { Console.Error.WriteLine ("Error: App started but could not retrieve PID. The app may have crashed."); return 1; @@ -191,16 +288,16 @@ int RunApp () StartLogcat (); // 4. Wait for app to exit or Ctrl+C - WaitForAppExit (); + await WaitForAppExitAsync (); return 0; } -bool StartApp () +async Task StartAppAsync () { var userArg = string.IsNullOrEmpty (deviceUserId) ? "" : $" --user {deviceUserId}"; var cmdArgs = $"shell am start -S -W{userArg} -n \"{package}/{activity}\""; - var (exitCode, output, error) = RunAdb (cmdArgs); + var (exitCode, output, error) = await AdbHelper.RunAsync (adbPath, adbTarget, cmdArgs, cts.Token, verbose); if (exitCode != 0) { Console.Error.WriteLine ($"Error: Failed to start app: {error}"); return false; @@ -212,10 +309,10 @@ bool StartApp () return true; } -int? GetAppPid () +async Task GetAppPidAsync () { var cmdArgs = $"shell pidof {package}"; - var (exitCode, output, error) = RunAdb (cmdArgs); + var (exitCode, output, error) = await AdbHelper.RunAsync (adbPath, adbTarget, cmdArgs, cts.Token, verbose); if (exitCode != 0 || string.IsNullOrWhiteSpace (output)) return null; @@ -235,20 +332,12 @@ void StartLogcat () if (!string.IsNullOrEmpty (logcatArgs)) logcatArguments += $" {logcatArgs}"; - var fullArguments = string.IsNullOrEmpty (adbTarget) ? logcatArguments : $"{adbTarget} {logcatArguments}"; + var psi = AdbHelper.CreateStartInfo (adbPath, adbTarget, logcatArguments); if (verbose) - Console.WriteLine ($"Running: adb {fullArguments}"); + Console.WriteLine ($"Running: adb {psi.Arguments}"); var locker = new Lock(); - var psi = new ProcessStartInfo { - FileName = adbPath, - Arguments = fullArguments, - UseShellExecute = false, - RedirectStandardOutput = true, - RedirectStandardError = true, - CreateNoWindow = true, - }; logcatProcess = new Process { StartInfo = psi }; @@ -269,11 +358,11 @@ void StartLogcat () logcatProcess.BeginErrorReadLine (); } -void WaitForAppExit () +async Task WaitForAppExitAsync () { while (!cts!.Token.IsCancellationRequested) { // Check if app is still running - var pid = GetAppPid (); + var pid = await GetAppPidAsync (); if (pid == null || pid != logcatPid) { if (verbose) Console.WriteLine ("App has exited."); @@ -287,7 +376,7 @@ void WaitForAppExit () break; } - Thread.Sleep (1000); + await Task.Delay (1000, cts.Token).ConfigureAwait (ConfigureAwaitOptions.SuppressThrowing); } // Clean up logcat process @@ -302,13 +391,13 @@ void WaitForAppExit () } } -void StopApp () +async Task StopAppAsync () { if (string.IsNullOrEmpty (package) || string.IsNullOrEmpty (adbPath)) return; var userArg = string.IsNullOrEmpty (deviceUserId) ? "" : $" --user {deviceUserId}"; - RunAdb ($"shell am force-stop{userArg} {package}"); + await AdbHelper.RunAsync (adbPath, adbTarget, $"shell am force-stop{userArg} {package}", CancellationToken.None, verbose); } string? FindAdbPath () @@ -332,35 +421,6 @@ void StopApp () return null; } -(int ExitCode, string Output, string Error) RunAdb (string arguments) -{ - var fullArguments = string.IsNullOrEmpty (adbTarget) ? arguments : $"{adbTarget} {arguments}"; - - if (verbose) - Console.WriteLine ($"Running: adb {fullArguments}"); - - var psi = new ProcessStartInfo { - FileName = adbPath, - Arguments = fullArguments, - UseShellExecute = false, - RedirectStandardOutput = true, - RedirectStandardError = true, - CreateNoWindow = true, - }; - - using var process = Process.Start (psi); - if (process == null) - return (-1, "", "Failed to start process"); - - // Read both streams asynchronously to avoid potential deadlock - var outputTask = process.StandardOutput.ReadToEndAsync (); - var errorTask = process.StandardError.ReadToEndAsync (); - - process.WaitForExit (); - - return (process.ExitCode, outputTask.Result, errorTask.Result); -} - (string? Version, string? Commit) GetVersionInfo () { try { diff --git a/src/Microsoft.Android.Templates/androidtest/.template.config/template.json b/src/Microsoft.Android.Templates/androidtest/.template.config/template.json new file mode 100644 index 00000000000..413ec8d1d8a --- /dev/null +++ b/src/Microsoft.Android.Templates/androidtest/.template.config/template.json @@ -0,0 +1,34 @@ +{ + "$schema": "http://json.schemastore.org/template", + "author": "Microsoft", + "classifications": [ "Android", "Mobile", "Test" ], + "identity": "Microsoft.Android.AndroidTest", + "name": "Android Test Project", + "description": "A project for creating a .NET for Android test project using MSTest", + "shortName": "androidtest", + "tags": { + "language": "C#", + "type": "project" + }, + "sourceName": "AndroidTest1", + "preferNameDirectory": true, + "primaryOutputs": [ + { "path": "AndroidTest1.csproj" } + ], + "symbols": { + "packageName": { + "type": "parameter", + "description": "Overrides the package name in the AndroidManifest.xml", + "datatype": "string", + "replaces": "com.companyname.AndroidTest1" + }, + "supportedOSVersion": { + "type": "parameter", + "description": "Overrides $(SupportedOSPlatformVersion) in the project", + "datatype": "string", + "replaces": "SUPPORTED_OS_PLATFORM_VERSION", + "defaultValue": "24" + } + }, + "defaultName": "AndroidTest1" +} diff --git a/src/Microsoft.Android.Templates/androidtest/AndroidManifest.xml b/src/Microsoft.Android.Templates/androidtest/AndroidManifest.xml new file mode 100644 index 00000000000..c2166bb216e --- /dev/null +++ b/src/Microsoft.Android.Templates/androidtest/AndroidManifest.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/Microsoft.Android.Templates/androidtest/AndroidTest1.csproj b/src/Microsoft.Android.Templates/androidtest/AndroidTest1.csproj new file mode 100644 index 00000000000..2e31f4cf8d4 --- /dev/null +++ b/src/Microsoft.Android.Templates/androidtest/AndroidTest1.csproj @@ -0,0 +1,27 @@ + + + net11.0-android + SUPPORTED_OS_PLATFORM_VERSION + AndroidTest1 + Exe + enable + enable + true + com.companyname.AndroidTest1 + 1 + 1.0 + + full + + + + + + + + + + diff --git a/src/Microsoft.Android.Templates/androidtest/Test1.cs b/src/Microsoft.Android.Templates/androidtest/Test1.cs new file mode 100644 index 00000000000..97ca260a405 --- /dev/null +++ b/src/Microsoft.Android.Templates/androidtest/Test1.cs @@ -0,0 +1,22 @@ +namespace AndroidTest1; + +[TestClass] +public sealed class Test1 +{ + [TestMethod] + public void TestMethod1() + { + } + + [TestMethod] + public void TestMethod2() + { + Assert.Fail("This test is expected to fail"); + } + + [TestMethod] + public void TestMethod3() + { + Assert.Inconclusive("This test is expected to be skipped"); + } +} diff --git a/src/Microsoft.Android.Templates/androidtest/TestInstrumentation.cs b/src/Microsoft.Android.Templates/androidtest/TestInstrumentation.cs new file mode 100644 index 00000000000..f05fa175843 --- /dev/null +++ b/src/Microsoft.Android.Templates/androidtest/TestInstrumentation.cs @@ -0,0 +1,107 @@ +using Android.Runtime; +using Microsoft.Testing.Extensions; +using Microsoft.Testing.Platform.Builder; +using Microsoft.Testing.Platform.Extensions; +using Microsoft.Testing.Platform.Extensions.Messages; + +[assembly: Parallelize(Scope = ExecutionScope.MethodLevel)] + +namespace AndroidTest1; + +[Instrumentation(Name = "com.companyname.AndroidTest1.TestInstrumentation")] +public class TestInstrumentation : Instrumentation +{ + protected TestInstrumentation(IntPtr handle, JniHandleOwnership ownership) + : base(handle, ownership) { } + + public override void OnCreate(Bundle? arguments) + { + base.OnCreate(arguments); + Start(); + } + + public override void OnStart() + { + base.OnStart(); + + Task.Run(async () => + { + var consumer = new ResultConsumer(this); + var bundle = new Bundle(); + try + { + var writeablePath = Application.Context.GetExternalFilesDir(null)?.AbsolutePath ?? Path.GetTempPath(); + var resultsPath = Path.Combine(writeablePath, "TestResults"); + var builder = await TestApplication.CreateBuilderAsync([ + "--results-directory", resultsPath, + "--report-trx" + ]); + builder.AddMSTest(() => [GetType().Assembly]); + builder.AddTrxReportProvider(); + builder.TestHost.AddDataConsumer(_ => consumer); + + using ITestApplication app = await builder.BuildAsync(); + await app.RunAsync(); + + bundle.PutInt("passed", consumer.Passed); + bundle.PutInt("failed", consumer.Failed); + bundle.PutInt("skipped", consumer.Skipped); + bundle.PutString("resultsPath", consumer.TrxReportPath); + Finish(Result.Ok, bundle); + } + catch (Exception ex) + { + bundle.PutString("error", ex.ToString()); + Finish(Result.Canceled, bundle); + } + }); + } + + class ResultConsumer(Instrumentation instrumentation) : IDataConsumer + { + int _passed, _failed, _skipped; + public int Passed => _passed; + public int Failed => _failed; + public int Skipped => _skipped; + public string? TrxReportPath; + + public string Uid => nameof(ResultConsumer); + public string DisplayName => nameof(ResultConsumer); + public string Description => ""; + public string Version => "1.0"; + public Task IsEnabledAsync() => Task.FromResult(true); + + public Type[] DataTypesConsumed => [typeof(TestNodeUpdateMessage), typeof(SessionFileArtifact)]; + + public Task ConsumeAsync(IDataProducer dataProducer, IData value, CancellationToken cancellationToken) + { + if (value is SessionFileArtifact artifact) + { + TrxReportPath = artifact.FileInfo.FullName; + } + else if (value is TestNodeUpdateMessage { TestNode: var node }) + { + var state = node.Properties.SingleOrDefault(); + string? outcome = state switch + { + PassedTestNodeStateProperty => "passed", + FailedTestNodeStateProperty or ErrorTestNodeStateProperty + or TimeoutTestNodeStateProperty => "failed", + SkippedTestNodeStateProperty => "skipped", + _ => null + }; + if (outcome is null) + return Task.CompletedTask; + + _ = outcome switch { "passed" => Interlocked.Increment(ref _passed), "failed" => Interlocked.Increment(ref _failed), _ => Interlocked.Increment(ref _skipped) }; + + var id = node.Properties.SingleOrDefault(); + var b = new Bundle(); + b.PutString("test", id is not null ? $"{id.Namespace}.{id.TypeName}.{id.MethodName}" : node.DisplayName); + b.PutString("outcome", outcome); + instrumentation.SendStatus(0, b); + } + return Task.CompletedTask; + } + } +} diff --git a/src/Microsoft.Android.Templates/androidtest/global.json b/src/Microsoft.Android.Templates/androidtest/global.json new file mode 100644 index 00000000000..3140116df39 --- /dev/null +++ b/src/Microsoft.Android.Templates/androidtest/global.json @@ -0,0 +1,5 @@ +{ + "test": { + "runner": "Microsoft.Testing.Platform" + } +} diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.Application.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.Application.targets index db06edf2e52..81a9af51cfa 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.Application.targets +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.Application.targets @@ -9,6 +9,7 @@ This file contains targets specific for Android application projects. + @@ -106,10 +107,15 @@ This file contains targets specific for Android application projects. BeforeTargets="ComputeRunArguments" DependsOnTargets="$(_AndroidComputeRunArgumentsDependsOn)"> + + + $(MSBuildProjectDirectory) @@ -119,8 +125,10 @@ This file contains targets specific for Android application projects. <_AndroidRunLogcatArgs Condition=" '$(_AndroidRunLogcatArgs)' == '' ">monodroid-assembly:S <_AndroidRunAdbTargetArg Condition=" '$(AdbTarget)' != '' ">--adb-target "$(AdbTarget)" <_AndroidRunUserArg Condition=" '$(AndroidDeviceUserId)' != '' ">--user "$(AndroidDeviceUserId)" + <_AndroidRunInstrumentArg Condition=" '$(AndroidInstrumentation)' != '' ">--instrument "$(AndroidInstrumentation)" + <_AndroidRunActivityArg Condition=" '$(AndroidInstrumentation)' == '' ">--activity "$(AndroidLaunchActivity)" dotnet - exec "$(_AndroidRunPath)" --adb "$(_AdbToolPath)" $(_AndroidRunAdbTargetArg) --package "$(_AndroidPackage)" --activity "$(AndroidLaunchActivity)" --logcat-args "$(_AndroidRunLogcatArgs)" $(_AndroidRunUserArg) $(_AndroidRunExtraArgs) + exec "$(_AndroidRunPath)" --adb "$(_AdbToolPath)" $(_AndroidRunAdbTargetArg) --package "$(_AndroidPackage)" $(_AndroidRunActivityArg) $(_AndroidRunInstrumentArg) --logcat-args "$(_AndroidRunLogcatArgs)" $(_AndroidRunUserArg) $(_AndroidRunExtraArgs) diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets index 0d0a212b938..6c641ca33d9 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets @@ -35,8 +35,36 @@ _ResolveAssemblies MSBuild target. <_RunAotMaybe Condition=" '$(_AndroidUseMarshalMethods)' != 'True' ">_AndroidAot + + + + + <_NoneAssembliesToPromote Include="@(None)" Condition=" '%(None.Extension)' == '.dll' and ('%(None.CopyToOutputDirectory)' == 'Always' or '%(None.CopyToOutputDirectory)' == 'PreserveNewest') and $([System.IO.Path]::GetFileName('%(None.Link)').Equals('%(None.Link)')) " /> + + + + + + + diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs b/src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs index bc2d9a7d4d4..0cfab8f6f71 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs @@ -10,8 +10,8 @@ namespace Xamarin.Android.Tasks.Properties { using System; - - + + /// /// A strongly-typed resource class, for looking up localized strings, etc. /// @@ -23,15 +23,15 @@ namespace Xamarin.Android.Tasks.Properties { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] public class Resources { - + private static global::System.Resources.ResourceManager resourceMan; - + private static global::System.Globalization.CultureInfo resourceCulture; - + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Resources() { } - + /// /// Returns the cached ResourceManager instance used by this class. /// @@ -45,7 +45,7 @@ internal Resources() { return resourceMan; } } - + /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. @@ -59,7 +59,7 @@ internal Resources() { resourceCulture = value; } } - + /// /// Looks up a localized string similar to {0}. /// @@ -70,7 +70,7 @@ public static string AAPTManifestError { return ResourceManager.GetString("AAPTManifestError", resourceCulture); } } - + /// /// Looks up a localized string similar to Unknown option `{0}`. Please check `$(AndroidAapt2CompileExtraArgs)` and `$(AndroidAapt2LinkExtraArgs)` to see if they include any `aapt` command line arguments that are no longer valid for `aapt2` and ensure that all other arguments are valid for `aapt2`.. /// @@ -79,7 +79,7 @@ public static string APT0001 { return ResourceManager.GetString("APT0001", resourceCulture); } } - + /// /// Looks up a localized string similar to Invalid file name: It must contain only {0}.. /// @@ -88,7 +88,7 @@ public static string APT0002 { return ResourceManager.GetString("APT0002", resourceCulture); } } - + /// /// Looks up a localized string similar to Invalid file name: It must contain only {0}.. /// @@ -97,7 +97,7 @@ public static string APT0003 { return ResourceManager.GetString("APT0003", resourceCulture); } } - + /// /// Looks up a localized string similar to Invalid file name: It must start with A-z or a-z or an underscore.. /// @@ -106,7 +106,7 @@ public static string APT0004 { return ResourceManager.GetString("APT0004", resourceCulture); } } - + /// /// Looks up a localized string similar to Invalid file name: Filenames cannot use Java reserved words.. /// @@ -115,7 +115,7 @@ public static string APT0005 { return ResourceManager.GetString("APT0005", resourceCulture); } } - + /// /// Looks up a localized string similar to This could be caused by the project exceeding the Windows maximum path length limitation. See https://learn.microsoft.com/dotnet/android/messages/apt2264 for details.. /// @@ -124,7 +124,7 @@ public static string APT2264 { return ResourceManager.GetString("APT2264", resourceCulture); } } - + /// /// Looks up a localized string similar to This could be caused by the project having non-ASCII characters in its filename or path. See https://learn.microsoft.com/dotnet/android/messages/apt2265 for details.. /// @@ -133,7 +133,7 @@ public static string APT2265 { return ResourceManager.GetString("APT2265", resourceCulture); } } - + /// /// Looks up a localized string similar to Directory '{0}' is from '{1}'.. /// @@ -142,9 +142,9 @@ public static string XA_Directory_Is_From { return ResourceManager.GetString("XA_Directory_Is_From", resourceCulture); } } - + /// - /// Looks up a localized string similar to + /// Looks up a localized string similar to /// This code was generated by a tool. /// It was generated from {0} /// Changes to this file may cause incorrect behavior and will be lost if @@ -156,7 +156,7 @@ public static string XA_Manifest_AutoGenerated_Header { return ResourceManager.GetString("XA_Manifest_AutoGenerated_Header", resourceCulture); } } - + /// /// Looks up a localized string similar to Could not determine API level for $(TargetFrameworkVersion) of '{0}'.. /// @@ -165,7 +165,7 @@ public static string XA0000_API_for_TargetFrameworkVersion { return ResourceManager.GetString("XA0000_API_for_TargetFrameworkVersion", resourceCulture); } } - + /// /// Looks up a localized string similar to Could not determine $(AndroidApiLevel) or $(TargetFrameworkVersion); should not be reached.. /// @@ -174,7 +174,7 @@ public static string XA0000_API_or_TargetFrameworkVersion_Fail { return ResourceManager.GetString("XA0000_API_or_TargetFrameworkVersion_Fail", resourceCulture); } } - + /// /// Looks up a localized string similar to Unhandled exception: {0}. /// @@ -183,7 +183,7 @@ public static string XA0000_Exception { return ResourceManager.GetString("XA0000_Exception", resourceCulture); } } - + /// /// Looks up a localized string similar to Could not determine $(TargetFrameworkVersion) for API level '{0}.'. /// @@ -192,7 +192,7 @@ public static string XA0000_TargetFrameworkVersion_for_API { return ResourceManager.GetString("XA0000_TargetFrameworkVersion_for_API", resourceCulture); } } - + /// /// Looks up a localized string similar to Unsupported or invalid $(TargetFrameworkVersion) value of '{0}'. Please update your Project Options.. /// @@ -201,7 +201,7 @@ public static string XA0001 { return ResourceManager.GetString("XA0001", resourceCulture); } } - + /// /// Looks up a localized string similar to Could not find mono.android.jar. /// @@ -210,7 +210,7 @@ public static string XA0002 { return ResourceManager.GetString("XA0002", resourceCulture); } } - + /// /// Looks up a localized string similar to Invalid `android:versionCode` value `{0}` in `AndroidManifest.xml`. It must be an integer value.. /// @@ -219,7 +219,7 @@ public static string XA0003 { return ResourceManager.GetString("XA0003", resourceCulture); } } - + /// /// Looks up a localized string similar to Invalid `android:versionCode` value `{0}` in `AndroidManifest.xml`. The value must be in the range of 0 to {1}.. /// @@ -228,7 +228,7 @@ public static string XA0004 { return ResourceManager.GetString("XA0004", resourceCulture); } } - + /// /// Looks up a localized string similar to Building with JDK version `{0}` is not supported. Please install JDK version `{1}`. See https://aka.ms/xamarin/jdk9-errors. /// @@ -237,7 +237,7 @@ public static string XA0030 { return ResourceManager.GetString("XA0030", resourceCulture); } } - + /// /// Looks up a localized string similar to Java SDK {0} or above is required when using {1}. ///Download the latest JDK at: https://aka.ms/msopenjdk @@ -248,7 +248,7 @@ public static string XA0031 { return ResourceManager.GetString("XA0031", resourceCulture); } } - + /// /// Looks up a localized string similar to Java SDK {0} or above is required when using .NET 6 or higher. Download the latest JDK at: https://aka.ms/msopenjdk. /// @@ -257,7 +257,7 @@ public static string XA0031_NET { return ResourceManager.GetString("XA0031_NET", resourceCulture); } } - + /// /// Looks up a localized string similar to Java SDK {0} or above is required when using Android SDK Build-Tools {1}.. /// @@ -266,7 +266,7 @@ public static string XA0032 { return ResourceManager.GetString("XA0032", resourceCulture); } } - + /// /// Looks up a localized string similar to Failed to get the Java SDK version because the returned value does not appear to contain a valid version number. `{0} -version` returned: ```{1}```. /// @@ -275,7 +275,7 @@ public static string XA0033 { return ResourceManager.GetString("XA0033", resourceCulture); } } - + /// /// Looks up a localized string similar to Failed to get the Java SDK version. Please ensure you have Java {0} or above installed.. /// @@ -284,7 +284,7 @@ public static string XA0034 { return ResourceManager.GetString("XA0034", resourceCulture); } } - + /// /// Looks up a localized string similar to Unable to determine the Android ABI from the value '{0}'. Edit the project file in a text editor and set the 'RuntimeIdentifiers' MSBuild property to contain only valid identifiers for the Android platform.. /// @@ -293,7 +293,7 @@ public static string XA0035 { return ResourceManager.GetString("XA0035", resourceCulture); } } - + /// /// Looks up a localized string similar to The 'AndroidSupportedAbis' MSBuild property is no longer supported. Edit the project file in a text editor, remove any uses of 'AndroidSupportedAbis', and use the 'RuntimeIdentifiers' MSBuild property instead.. /// @@ -302,7 +302,7 @@ public static string XA0036 { return ResourceManager.GetString("XA0036", resourceCulture); } } - + /// /// Looks up a localized string similar to EmbeddedNativeLibrary '{0}' is invalid in Android Application projects. Please use AndroidNativeLibrary instead.. /// @@ -311,7 +311,7 @@ public static string XA0100 { return ResourceManager.GetString("XA0100", resourceCulture); } } - + /// /// Looks up a localized string similar to Invalid value for `$(AndroidSequencePointsMode)`: {0}. /// @@ -320,7 +320,7 @@ public static string XA0104 { return ResourceManager.GetString("XA0104", resourceCulture); } } - + /// /// Looks up a localized string similar to The $(TargetFrameworkVersion) for {0} ({1}) is greater than the $(TargetFrameworkVersion) for the application project ({2}). Please increase the $(TargetFrameworkVersion) for the application project.. /// @@ -329,7 +329,7 @@ public static string XA0105 { return ResourceManager.GetString("XA0105", resourceCulture); } } - + /// /// Looks up a localized string similar to {0} is a Reference Assembly.. /// @@ -338,7 +338,7 @@ public static string XA0107 { return ResourceManager.GetString("XA0107", resourceCulture); } } - + /// /// Looks up a localized string similar to Ignoring Reference Assembly `{0}`.. /// @@ -347,7 +347,7 @@ public static string XA0107_Ignoring { return ResourceManager.GetString("XA0107_Ignoring", resourceCulture); } } - + /// /// Looks up a localized string similar to Could not get version from '{0}'. Defaulting to 1.0. /// @@ -356,7 +356,7 @@ public static string XA0108 { return ResourceManager.GetString("XA0108", resourceCulture); } } - + /// /// Looks up a localized string similar to Unsupported version of AAPT2 found at path '{0}'. Open the project file in a text editor and remove the 'Aapt2ToolPath' MSBuild property or ensure it is set to a valid location.. /// @@ -365,7 +365,7 @@ public static string XA0111 { return ResourceManager.GetString("XA0111", resourceCulture); } } - + /// /// Looks up a localized string similar to AAPT2 was not found at path '{0}'. Open the project file in a text editor and remove the 'Aapt2ToolPath' MSBuild property or ensure it is set to a valid location.. /// @@ -374,7 +374,7 @@ public static string XA0112 { return ResourceManager.GetString("XA0112", resourceCulture); } } - + /// /// Looks up a localized string similar to Google Play requires that new applications and updates must use a TargetFrameworkVersion of {0} (API level {1}) or above. You are currently targeting {2} (API level {3}).. /// @@ -383,7 +383,7 @@ public static string XA0113 { return ResourceManager.GetString("XA0113", resourceCulture); } } - + /// /// Looks up a localized string similar to Unable to find `EmbeddedResource` named `{0}`.. /// @@ -392,7 +392,7 @@ public static string XA0116 { return ResourceManager.GetString("XA0116", resourceCulture); } } - + /// /// Looks up a localized string similar to The TargetFrameworkVersion {0} is deprecated. Please update it to be v5.0 or higher.. /// @@ -401,7 +401,7 @@ public static string XA0117 { return ResourceManager.GetString("XA0117", resourceCulture); } } - + /// /// Looks up a localized string similar to Could not parse '{0}'. /// @@ -410,7 +410,7 @@ public static string XA0118_Parse { return ResourceManager.GetString("XA0118_Parse", resourceCulture); } } - + /// /// Looks up a localized string similar to Could not resolve `target` in lock file for '{0}'. /// @@ -419,7 +419,7 @@ public static string XA0118_Target { return ResourceManager.GetString("XA0118_Target", resourceCulture); } } - + /// /// Looks up a localized string similar to Using Fast Deployment and Android App Bundles at the same time is not currently supported. Use Fast Deployment for Debug configurations and Android App Bundles for Release configurations.. /// @@ -428,7 +428,7 @@ public static string XA0119_AAB { return ResourceManager.GetString("XA0119_AAB", resourceCulture); } } - + /// /// Looks up a localized string similar to Using fast deployment and AOT at the same time is not recommended. Use fast deployment for Debug configurations and AOT for Release configurations.. /// @@ -437,7 +437,7 @@ public static string XA0119_AOT { return ResourceManager.GetString("XA0119_AOT", resourceCulture); } } - + /// /// Looks up a localized string similar to Disabling the interpreter; using the interpreter and AOT at the same time is not supported. Use the interpreter for hot reload support in Debug configurations and AOT for Release configurations.. /// @@ -446,7 +446,7 @@ public static string XA0119_Interpreter { return ResourceManager.GetString("XA0119_Interpreter", resourceCulture); } } - + /// /// Looks up a localized string similar to Using fast deployment and the linker at the same time is not recommended. Use fast deployment for Debug configurations and the linker for Release configurations.. /// @@ -455,7 +455,7 @@ public static string XA0119_LinkMode { return ResourceManager.GetString("XA0119_LinkMode", resourceCulture); } } - + /// /// Looks up a localized string similar to Using fast deployment and a code shrinker at the same time is not recommended. Use fast deployment for Debug configurations and a code shrinker for Release configurations.. /// @@ -464,7 +464,7 @@ public static string XA0119_LinkTool { return ResourceManager.GetString("XA0119_LinkTool", resourceCulture); } } - + /// /// Looks up a localized string similar to Assembly '{0}' is using '[assembly: {1}]', which is no longer supported. Use a newer version of this NuGet package or notify the library author.. /// @@ -473,7 +473,7 @@ public static string XA0121 { return ResourceManager.GetString("XA0121", resourceCulture); } } - + /// /// Looks up a localized string similar to Assembly '{0}' is using a deprecated attribute '[assembly: {1}]'. Use a newer version of this NuGet package or notify the library author.. /// @@ -482,7 +482,7 @@ public static string XA0122 { return ResourceManager.GetString("XA0122", resourceCulture); } } - + /// /// Looks up a localized string similar to Removing {0} from {1}. Lint {2} does not support this check.. /// @@ -491,7 +491,7 @@ public static string XA0123 { return ResourceManager.GetString("XA0123", resourceCulture); } } - + /// /// Looks up a localized string similar to '{0}' is using a deprecated debug information level. ///Set the debugging information to Portable in the Visual Studio project property pages or edit the project file in a text editor and set the 'DebugType' MSBuild property to 'portable' to use the newer, cross-platform debug information level. @@ -502,7 +502,7 @@ public static string XA0125 { return ResourceManager.GetString("XA0125", resourceCulture); } } - + /// /// Looks up a localized string similar to %(AndroidAsset.AssetPack) and %(AndroidAsset.AssetPack) item metadata are only supported when `$(AndroidApplication)` is `true`.. /// @@ -511,7 +511,7 @@ public static string XA0138 { return ResourceManager.GetString("XA0138", resourceCulture); } } - + /// /// Looks up a localized string similar to `@(AndroidAsset)` `{0}` has an invalid `DeliveryType` metadata of `{1}`. Supported values are `installtime`, `ondemand` or `fastfollow`.. /// @@ -520,7 +520,7 @@ public static string XA0139 { return ResourceManager.GetString("XA0139", resourceCulture); } } - + /// /// Looks up a localized string similar to The AssetPack value defined for `{0}` has invalid characters. `{1}` should only contain A-z, a-z, 0-9 or an underscore.. /// @@ -529,7 +529,7 @@ public static string XA0140 { return ResourceManager.GetString("XA0140", resourceCulture); } } - + /// /// Looks up a localized string similar to Android 16 will require 16 KB page sizes, shared library '{3}' does not have a 16 KB page size. Please inform the authors of the NuGet package '{0}' version '{1}' which contains '{2}'. See https://developer.android.com/guide/practices/page-sizes for more details.. /// @@ -538,7 +538,7 @@ public static string XA0141 { return ResourceManager.GetString("XA0141", resourceCulture); } } - + /// /// Looks up a localized string similar to Command '{0}' failed.\n{1}. /// @@ -547,7 +547,7 @@ public static string XA0142 { return ResourceManager.GetString("XA0142", resourceCulture); } } - + /// /// Looks up a localized string similar to Failed to launch the Android emulator for AVD '{0}': {1}. /// @@ -556,7 +556,7 @@ public static string XA0143 { return ResourceManager.GetString("XA0143", resourceCulture); } } - + /// /// Looks up a localized string similar to The Android emulator for AVD '{0}' failed with error '{1}': {2}. /// @@ -565,7 +565,7 @@ public static string XA0144 { return ResourceManager.GetString("XA0144", resourceCulture); } } - + /// /// Looks up a localized string similar to The Android emulator for AVD '{0}' did not finish booting within {1} seconds. Increase 'BootTimeoutSeconds' or check the emulator configuration.. /// @@ -574,7 +574,7 @@ public static string XA0145 { return ResourceManager.GetString("XA0145", resourceCulture); } } - + /// /// Looks up a localized string similar to There was a problem parsing {0}. This is likely due to incomplete or invalid XML. Exception: {1}. /// @@ -583,7 +583,7 @@ public static string XA1000 { return ResourceManager.GetString("XA1000", resourceCulture); } } - + /// /// Looks up a localized string similar to AndroidResgen: Warning while updating resource XML '{0}': {1}. /// @@ -592,7 +592,7 @@ public static string XA1001 { return ResourceManager.GetString("XA1001", resourceCulture); } } - + /// /// Looks up a localized string similar to The closest match found for '{0}' is '{1}', but the capitalization does not match. Please correct the capitalization.. /// @@ -601,7 +601,7 @@ public static string XA1002 { return ResourceManager.GetString("XA1002", resourceCulture); } } - + /// /// Looks up a localized string similar to Attempting basic type name matching for element with ID '{0}' and type '{1}'. /// @@ -610,7 +610,7 @@ public static string XA1005 { return ResourceManager.GetString("XA1005", resourceCulture); } } - + /// /// Looks up a localized string similar to If basic type name matching fails, please add a `xamarin:managedType` attribute to the element to specify the fully qualified managed type name of the element.. /// @@ -619,7 +619,7 @@ public static string XA1005_Instructions { return ResourceManager.GetString("XA1005_Instructions", resourceCulture); } } - + /// /// Looks up a localized string similar to The TargetFrameworkVersion (Android API level {0}) is higher than the targetSdkVersion ({1}). Please increase the `android:targetSdkVersion` in the `AndroidManifest.xml` so that the API levels match.. /// @@ -628,7 +628,7 @@ public static string XA1006 { return ResourceManager.GetString("XA1006", resourceCulture); } } - + /// /// Looks up a localized string similar to The minSdkVersion ({0}) is greater than the targetSdkVersion. Please change the value such that the minSdkVersion is less than or equal to the targetSdkVersion ({1}).. /// @@ -637,7 +637,7 @@ public static string XA1007 { return ResourceManager.GetString("XA1007", resourceCulture); } } - + /// /// Looks up a localized string similar to The TargetFrameworkVersion (Android API level {0}) is lower than the targetSdkVersion ({1}). Please increase the `$(TargetFrameworkVersion)` or decrease the `android:targetSdkVersion` in the `AndroidManifest.xml` so that the API levels match.. /// @@ -646,7 +646,7 @@ public static string XA1008 { return ResourceManager.GetString("XA1008", resourceCulture); } } - + /// /// Looks up a localized string similar to Invalid `$(AndroidManifestPlaceholders)` value for Android manifest placeholders. Please use `key1=value1;key2=value2` format. The specified value was: `{0}`. /// @@ -655,7 +655,7 @@ public static string XA1010 { return ResourceManager.GetString("XA1010", resourceCulture); } } - + /// /// Looks up a localized string similar to Using ProGuard with the D8 DEX compiler is no longer supported. Please set the code shrinker to 'r8' in the Visual Studio project property pages or edit the project file in a text editor and set the 'AndroidLinkTool' MSBuild property to 'r8'.. /// @@ -664,7 +664,7 @@ public static string XA1011 { return ResourceManager.GetString("XA1011", resourceCulture); } } - + /// /// Looks up a localized string similar to Included layout root element override ID '{0}' is not valid.. /// @@ -673,7 +673,7 @@ public static string XA1012 { return ResourceManager.GetString("XA1012", resourceCulture); } } - + /// /// Looks up a localized string similar to Failed to parse ID of node '{0}' in the layout file '{1}'.. /// @@ -682,7 +682,7 @@ public static string XA1013 { return ResourceManager.GetString("XA1013", resourceCulture); } } - + /// /// Looks up a localized string similar to JAR library references with identical file names but different contents were found: {0}. Please remove any conflicting libraries from EmbeddedJar, InputJar and AndroidJavaLibrary.. /// @@ -691,7 +691,7 @@ public static string XA1014 { return ResourceManager.GetString("XA1014", resourceCulture); } } - + /// /// Looks up a localized string similar to More than one Android Wear project is specified as the paired project. It can be at most one.. /// @@ -700,7 +700,7 @@ public static string XA1015 { return ResourceManager.GetString("XA1015", resourceCulture); } } - + /// /// Looks up a localized string similar to Target Wear application's project '{0}' does not specify required 'AndroidManifest' project property.. /// @@ -709,7 +709,7 @@ public static string XA1016 { return ResourceManager.GetString("XA1016", resourceCulture); } } - + /// /// Looks up a localized string similar to Target Wear application's AndroidManifest.xml does not specify required 'package' attribute.. /// @@ -718,7 +718,7 @@ public static string XA1017 { return ResourceManager.GetString("XA1017", resourceCulture); } } - + /// /// Looks up a localized string similar to Specified AndroidManifest file does not exist: {0}.. /// @@ -727,7 +727,7 @@ public static string XA1018 { return ResourceManager.GetString("XA1018", resourceCulture); } } - + /// /// Looks up a localized string similar to `LibraryProjectProperties` file `{0}` is located in a parent directory of the bindings project's intermediate output directory. Please adjust the path to use the original `project.properties` file directly from the Android library project directory.. /// @@ -736,7 +736,7 @@ public static string XA1019 { return ResourceManager.GetString("XA1019", resourceCulture); } } - + /// /// Looks up a localized string similar to At least one Java library is required for binding. Check that a Java library is included in the project and has the appropriate build action: 'LibraryProjectZip' (for AAR or ZIP), 'EmbeddedJar', 'InputJar' (for JAR), or 'LibraryProjectProperties' (project.properties).. /// @@ -745,7 +745,7 @@ public static string XA1020 { return ResourceManager.GetString("XA1020", resourceCulture); } } - + /// /// Looks up a localized string similar to Specified source Java library not found: {0}. /// @@ -754,7 +754,7 @@ public static string XA1021 { return ResourceManager.GetString("XA1021", resourceCulture); } } - + /// /// Looks up a localized string similar to Specified reference Java library not found: {0}. /// @@ -763,7 +763,7 @@ public static string XA1022 { return ResourceManager.GetString("XA1022", resourceCulture); } } - + /// /// Looks up a localized string similar to Using the DX DEX Compiler is not supported. Please set the DEX compiler to 'd8' in the Visual Studio project property pages or edit the project file in a text editor and set the 'AndroidDexTool' MSBuild property to 'd8'.. /// @@ -772,7 +772,7 @@ public static string XA1023 { return ResourceManager.GetString("XA1023", resourceCulture); } } - + /// /// Looks up a localized string similar to Ignoring configuration file '{0}'. .NET configuration files are not supported in .NET for Android projects that target .NET 6 or higher.. /// @@ -781,7 +781,7 @@ public static string XA1024 { return ResourceManager.GetString("XA1024", resourceCulture); } } - + /// /// Looks up a localized string similar to The experimental 'Hybrid' value for the 'AndroidAotMode' MSBuild property is not currently compatible with the armeabi-v7a target ABI. To continue using the experimental 'Hybrid' value for 'AndroidAotMode', deselect the armeabi-v7a target ABI in the Visual Studio project property pages or edit the project file in a text editor and remove 'armeabi-v7a' from the 'AndroidSupportedAbis' MSBuild property.. /// @@ -790,7 +790,7 @@ public static string XA1025 { return ResourceManager.GetString("XA1025", resourceCulture); } } - + /// /// Looks up a localized string similar to The 'EnableProguard' MSBuild property is set to 'true' and the 'AndroidLinkTool' MSBuild property is empty, so 'AndroidLinkTool' will default to 'proguard'.. /// @@ -799,7 +799,7 @@ public static string XA1027 { return ResourceManager.GetString("XA1027", resourceCulture); } } - + /// /// Looks up a localized string similar to The 'AndroidEnableProguard' MSBuild property is set to 'true' and the 'AndroidLinkTool' MSBuild property is empty, so 'AndroidLinkTool' will default to 'proguard'.. /// @@ -808,7 +808,7 @@ public static string XA1028 { return ResourceManager.GetString("XA1028", resourceCulture); } } - + /// /// Looks up a localized string similar to The 'AotAssemblies' MSBuild property is deprecated. Edit the project file in a text editor to remove this property, and use the 'RunAOTCompilation' MSBuild property instead.. /// @@ -817,7 +817,7 @@ public static string XA1029 { return ResourceManager.GetString("XA1029", resourceCulture); } } - + /// /// Looks up a localized string similar to The 'RunAOTCompilation' MSBuild property is only supported when trimming is enabled. Edit the project file in a text editor to set 'PublishTrimmed' to 'true' for this build configuration.. /// @@ -826,7 +826,7 @@ public static string XA1030 { return ResourceManager.GetString("XA1030", resourceCulture); } } - + /// /// Looks up a localized string similar to The 'AndroidHttpClientHandlerType' property value '{0}' must derive from '{1}'. ///Please change the value to an assembly-qualifed type name which inherits from '{1}' or remove the property completely.. @@ -836,7 +836,7 @@ public static string XA1031 { return ResourceManager.GetString("XA1031", resourceCulture); } } - + /// /// Looks up a localized string similar to The 'AndroidHttpClientHandlerType' property value '{0}' must not derive from 'System.Net.Htt.HttpClientHandler'. ///Please change the value to an assembly-qualifed type name which inherits from 'System.Net.Http.HttpMessageHandler' or remove the property completely.. @@ -846,7 +846,7 @@ public static string XA1031_HCH { return ResourceManager.GetString("XA1031_HCH", resourceCulture); } } - + /// /// Looks up a localized string similar to Failed to resolve '{0}' from '{1}'. Please check your `AndroidHttpClientHandlerType` setting.. /// @@ -855,7 +855,7 @@ public static string XA1032 { return ResourceManager.GetString("XA1032", resourceCulture); } } - + /// /// Looks up a localized string similar to Could not resolve '{0}'. Please check your `AndroidHttpClientHandlerType` setting.. /// @@ -864,7 +864,7 @@ public static string XA1033 { return ResourceManager.GetString("XA1033", resourceCulture); } } - + /// /// Looks up a localized string similar to Your project references '{0}' which uses the `_Microsoft.Android.Resource.Designer` assembly, but you do not have this feature enabled. Please set the `AndroidUseDesignerAssembly` MSBuild property to `true` in your project file.. /// @@ -873,7 +873,7 @@ public static string XA1034 { return ResourceManager.GetString("XA1034", resourceCulture); } } - + /// /// Looks up a localized string similar to The 'BundleAssemblies' property is deprecated and it has no effect on the application build. Equivalent functionality is implemented by the 'AndroidUseAssemblyStore' and 'AndroidEnableAssemblyCompression' properties.. /// @@ -882,7 +882,7 @@ public static string XA1035 { return ResourceManager.GetString("XA1035", resourceCulture); } } - + /// /// Looks up a localized string similar to AndroidManifest.xml //uses-sdk/@android:minSdkVersion '{0}' does not match the $(SupportedOSPlatformVersion) value '{1}' in the project file (if there is no $(SupportedOSPlatformVersion) value in the project file, then a default value has been assumed). ///Either change the value in the AndroidManifest.xml to match the $(SupportedOSPlatformVersion) value, or remove the value in the AndroidManifest.xml (and add a $(SupportedOSPlatformVersion) value to the project file if it doesn't already exist).. @@ -892,7 +892,7 @@ public static string XA1036 { return ResourceManager.GetString("XA1036", resourceCulture); } } - + /// /// Looks up a localized string similar to The '{0}' MSBuild property is deprecated and will be removed in .NET {1}. See https://aka.ms/net-android-deprecations for more details.. /// @@ -901,7 +901,7 @@ public static string XA1037 { return ResourceManager.GetString("XA1037", resourceCulture); } } - + /// /// Looks up a localized string similar to The '{0}' MSBuild property has an invalid value of '{1}'. A valid value is one of: {2}.. /// @@ -910,7 +910,7 @@ public static string XA1038 { return ResourceManager.GetString("XA1038", resourceCulture); } } - + /// /// Looks up a localized string similar to The Android Support libraries are not supported in .NET 9 and later, please migrate to AndroidX. See https://aka.ms/net-android/androidx for more details.. /// @@ -919,7 +919,7 @@ public static string XA1039 { return ResourceManager.GetString("XA1039", resourceCulture); } } - + /// /// Looks up a localized string similar to The {0} runtime on Android is an experimental feature and not yet suitable for production use. File issues at: https://github.com/dotnet/android/issues. /// @@ -928,7 +928,7 @@ public static string XA1040 { return ResourceManager.GetString("XA1040", resourceCulture); } } - + /// /// Looks up a localized string similar to The MSBuild property '{0}' has an invalid value of '{1}'. The value is expected to be a directory path representing the relative location of your Assets or Resources.. /// @@ -937,7 +937,25 @@ public static string XA1041 { return ResourceManager.GetString("XA1041", resourceCulture); } } - + + /// + /// Looks up a localized string similar to The <instrumentation> element in AndroidManifest.xml is missing the android:name attribute.. + /// + public static string XA1042 { + get { + return ResourceManager.GetString("XA1042", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No <instrumentation> element found in AndroidManifest.xml.. + /// + public static string XA1043 { + get { + return ResourceManager.GetString("XA1043", resourceCulture); + } + } + /// /// Looks up a localized string similar to Use of AppDomain.CreateDomain() detected in assembly: {0}. .NET 6 and higher will only support a single AppDomain, so this API will no longer be available in .NET for Android once .NET 6 is released.. /// @@ -946,7 +964,7 @@ public static string XA2000 { return ResourceManager.GetString("XA2000", resourceCulture); } } - + /// /// Looks up a localized string similar to Support for the 'MONO_GC_PARAMS=bridge-implementation=old' value will be removed in .NET 7.. /// @@ -955,7 +973,7 @@ public static string XA2000_gcParams_bridgeImpl { return ResourceManager.GetString("XA2000_gcParams_bridgeImpl", resourceCulture); } } - + /// /// Looks up a localized string similar to Source file '{0}' could not be found.. /// @@ -964,7 +982,7 @@ public static string XA2001 { return ResourceManager.GetString("XA2001", resourceCulture); } } - + /// /// Looks up a localized string similar to Can not resolve reference: `{0}`, referenced by {1}. Perhaps it doesn't exist in the .NET for Android profile?. /// @@ -973,7 +991,7 @@ public static string XA2002_Framework { return ResourceManager.GetString("XA2002_Framework", resourceCulture); } } - + /// /// Looks up a localized string similar to Can not resolve reference: `{0}`, referenced by {1}. Please add a NuGet package or assembly reference for `{0}`, or remove the reference to `{2}`.. /// @@ -982,7 +1000,7 @@ public static string XA2002_NuGet { return ResourceManager.GetString("XA2002_NuGet", resourceCulture); } } - + /// /// Looks up a localized string similar to Could not resolve reference to '{0}' (defined in assembly '{1}') with scope '{2}'. When the scope is different from the defining assembly, it usually means that the type is forwarded.. /// @@ -991,7 +1009,7 @@ public static string XA2006 { return ResourceManager.GetString("XA2006", resourceCulture); } } - + /// /// Looks up a localized string similar to Exception while loading assemblies: {0}. /// @@ -1000,7 +1018,7 @@ public static string XA2007 { return ResourceManager.GetString("XA2007", resourceCulture); } } - + /// /// Looks up a localized string similar to In referenced assembly {0}, Java.Interop.DoNotPackageAttribute requires non-null file name.. /// @@ -1009,7 +1027,7 @@ public static string XA2008 { return ResourceManager.GetString("XA2008", resourceCulture); } } - + /// /// Looks up a localized string similar to Could not AOT the assembly: {0}. /// @@ -1018,7 +1036,7 @@ public static string XA3001 { return ResourceManager.GetString("XA3001", resourceCulture); } } - + /// /// Looks up a localized string similar to Invalid AOT mode: {0}. /// @@ -1027,7 +1045,7 @@ public static string XA3002 { return ResourceManager.GetString("XA3002", resourceCulture); } } - + /// /// Looks up a localized string similar to Android NDK r10d is buggy and provides an incompatible x86_64 libm.so. See https://code.google.com/p/android/issues/detail?id=161422.. /// @@ -1036,7 +1054,7 @@ public static string XA3004 { return ResourceManager.GetString("XA3004", resourceCulture); } } - + /// /// Looks up a localized string similar to The detected Android NDK version is incompatible with the targeted LLVM configuration. Please upgrade to NDK r10d or newer.. /// @@ -1045,7 +1063,7 @@ public static string XA3005 { return ResourceManager.GetString("XA3005", resourceCulture); } } - + /// /// Looks up a localized string similar to Could not compile native assembly file: {0}{1}. /// @@ -1054,7 +1072,7 @@ public static string XA3006 { return ResourceManager.GetString("XA3006", resourceCulture); } } - + /// /// Looks up a localized string similar to Could not link native shared library: {0}{1}. /// @@ -1063,7 +1081,7 @@ public static string XA3007 { return ResourceManager.GetString("XA3007", resourceCulture); } } - + /// /// Looks up a localized string similar to Failed to generate Java type for class: {0} due to {1}. /// @@ -1072,7 +1090,7 @@ public static string XA4209 { return ResourceManager.GetString("XA4209", resourceCulture); } } - + /// /// Looks up a localized string similar to Please add a reference to Mono.Android.Export.dll when using ExportAttribute or ExportFieldAttribute.. /// @@ -1081,7 +1099,7 @@ public static string XA4210 { return ResourceManager.GetString("XA4210", resourceCulture); } } - + /// /// Looks up a localized string similar to AndroidManifest.xml //uses-sdk/@android:targetSdkVersion '{0}' is less than $(TargetPlatformVersion) '{1}'. Using API-{2} for ACW compilation.. /// @@ -1090,7 +1108,7 @@ public static string XA4211 { return ResourceManager.GetString("XA4211", resourceCulture); } } - + /// /// Looks up a localized string similar to The type '{0}' must provide a public default constructor. /// @@ -1099,7 +1117,7 @@ public static string XA4213 { return ResourceManager.GetString("XA4213", resourceCulture); } } - + /// /// Looks up a localized string similar to The managed type `{0}` exists in multiple assemblies: {1}. Please refactor the managed type names in these assemblies so that they are not identical.. /// @@ -1108,7 +1126,7 @@ public static string XA4214 { return ResourceManager.GetString("XA4214", resourceCulture); } } - + /// /// Looks up a localized string similar to References to the type `{0}` will refer to `{0}, {1}`.. /// @@ -1117,7 +1135,7 @@ public static string XA4214_Result { return ResourceManager.GetString("XA4214_Result", resourceCulture); } } - + /// /// Looks up a localized string similar to The Java type `{0}` is generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted.. /// @@ -1126,7 +1144,7 @@ public static string XA4215 { return ResourceManager.GetString("XA4215", resourceCulture); } } - + /// /// Looks up a localized string similar to `{0}` generated by: {1}. /// @@ -1135,7 +1153,7 @@ public static string XA4215_Details { return ResourceManager.GetString("XA4215_Details", resourceCulture); } } - + /// /// Looks up a localized string similar to The deployment target '{0}' is not supported (the minimum is '{1}'). Please increase (or remove) the //uses-sdk/@android:minSdkVersion value in your AndroidManifest.xml.. /// @@ -1144,7 +1162,7 @@ public static string XA4216_MinSdkVersion { return ResourceManager.GetString("XA4216_MinSdkVersion", resourceCulture); } } - + /// /// Looks up a localized string similar to The deployment target '{0}' is not supported (the minimum is '{1}'). Please increase the $(SupportedOSPlatformVersion) property value in your project file.. /// @@ -1153,7 +1171,7 @@ public static string XA4216_SupportedOSPlatformVersion { return ResourceManager.GetString("XA4216_SupportedOSPlatformVersion", resourceCulture); } } - + /// /// Looks up a localized string similar to AndroidManifest.xml //uses-sdk/@android:targetSdkVersion '{0}' is less than API-{1}, this configuration is not supported.. /// @@ -1162,7 +1180,7 @@ public static string XA4216_TargetSdkVersion { return ResourceManager.GetString("XA4216_TargetSdkVersion", resourceCulture); } } - + /// /// Looks up a localized string similar to Unable to find //manifest/application/uses-library at path: {0}. /// @@ -1171,7 +1189,7 @@ public static string XA4218 { return ResourceManager.GetString("XA4218", resourceCulture); } } - + /// /// Looks up a localized string similar to Cannot find binding generator for language {0} or {1}.. /// @@ -1180,7 +1198,7 @@ public static string XA4219 { return ResourceManager.GetString("XA4219", resourceCulture); } } - + /// /// Looks up a localized string similar to Partial class item '{0}' does not have an associated binding for layout '{1}'.. /// @@ -1189,7 +1207,7 @@ public static string XA4220 { return ResourceManager.GetString("XA4220", resourceCulture); } } - + /// /// Looks up a localized string similar to No layout binding source files were generated.. /// @@ -1198,7 +1216,7 @@ public static string XA4221 { return ResourceManager.GetString("XA4221", resourceCulture); } } - + /// /// Looks up a localized string similar to No widgets found for layout ({0}).. /// @@ -1207,7 +1225,7 @@ public static string XA4222 { return ResourceManager.GetString("XA4222", resourceCulture); } } - + /// /// Looks up a localized string similar to Malformed full class name '{0}'. Missing namespace.. /// @@ -1216,7 +1234,7 @@ public static string XA4223 { return ResourceManager.GetString("XA4223", resourceCulture); } } - + /// /// Looks up a localized string similar to Malformed full class name '{0}'. Missing class name.. /// @@ -1225,7 +1243,7 @@ public static string XA4224 { return ResourceManager.GetString("XA4224", resourceCulture); } } - + /// /// Looks up a localized string similar to Widget '{0}' in layout '{1}' has multiple instances with different types. The property type will be set to: {2}. /// @@ -1234,7 +1252,7 @@ public static string XA4225 { return ResourceManager.GetString("XA4225", resourceCulture); } } - + /// /// Looks up a localized string similar to Resource item '{0}' does not have the required metadata item '{1}'.. /// @@ -1243,7 +1261,7 @@ public static string XA4226 { return ResourceManager.GetString("XA4226", resourceCulture); } } - + /// /// Looks up a localized string similar to Unable to find specified //activity-alias/@android:targetActivity: '{0}'. /// @@ -1252,7 +1270,7 @@ public static string XA4228 { return ResourceManager.GetString("XA4228", resourceCulture); } } - + /// /// Looks up a localized string similar to Unrecognized `TransformFile` root element: {0}.. /// @@ -1261,7 +1279,7 @@ public static string XA4229 { return ResourceManager.GetString("XA4229", resourceCulture); } } - + /// /// Looks up a localized string similar to Error parsing XML: {0}. /// @@ -1270,7 +1288,7 @@ public static string XA4230 { return ResourceManager.GetString("XA4230", resourceCulture); } } - + /// /// Looks up a localized string similar to The Android class parser value '{0}' is deprecated and will be removed in a future version of .NET for Android. Update the project properties to use 'class-parse'.. /// @@ -1279,7 +1297,7 @@ public static string XA4231 { return ResourceManager.GetString("XA4231", resourceCulture); } } - + /// /// Looks up a localized string similar to The Android code generation target '{0}' is deprecated and will be removed in a future version of .NET for Android. Update the project properties to use 'XAJavaInterop1'.. /// @@ -1288,7 +1306,7 @@ public static string XA4232 { return ResourceManager.GetString("XA4232", resourceCulture); } } - + /// /// Looks up a localized string similar to The <AndroidNamespaceReplacement> for '{0}' does not specify a 'Replacement' attribute.. /// @@ -1297,7 +1315,7 @@ public static string XA4233 { return ResourceManager.GetString("XA4233", resourceCulture); } } - + /// /// Looks up a localized string similar to '<{0}>' item '{1}' is missing required attribute '{2}'.. /// @@ -1306,7 +1324,7 @@ public static string XA4234 { return ResourceManager.GetString("XA4234", resourceCulture); } } - + /// /// Looks up a localized string similar to Maven artifact specification '{0}' is invalid. The correct format is 'group_id:artifact_id'.. /// @@ -1315,7 +1333,7 @@ public static string XA4235 { return ResourceManager.GetString("XA4235", resourceCulture); } } - + /// /// Looks up a localized string similar to Cannot download Maven artifact '{0}:{1}'. ///{2}. @@ -1325,7 +1343,7 @@ public static string XA4236 { return ResourceManager.GetString("XA4236", resourceCulture); } } - + /// /// Looks up a localized string similar to Cannot download POM file for Maven artifact '{0}'. ///- {1}. @@ -1335,7 +1353,7 @@ public static string XA4237 { return ResourceManager.GetString("XA4237", resourceCulture); } } - + /// /// Looks up a localized string similar to Unknown Maven repository: '{0}'.. /// @@ -1344,7 +1362,7 @@ public static string XA4239 { return ResourceManager.GetString("XA4239", resourceCulture); } } - + /// /// Looks up a localized string similar to Java dependency '{0}' is not satisfied.. /// @@ -1353,7 +1371,7 @@ public static string XA4241 { return ResourceManager.GetString("XA4241", resourceCulture); } } - + /// /// Looks up a localized string similar to Java dependency '{0}' is not satisfied. Microsoft maintains the NuGet package '{1}' that could fulfill this dependency.. /// @@ -1362,7 +1380,7 @@ public static string XA4242 { return ResourceManager.GetString("XA4242", resourceCulture); } } - + /// /// Looks up a localized string similar to Attribute '{0}' is required when using '{1}' for '{2}' item '{3}'.. /// @@ -1371,7 +1389,7 @@ public static string XA4243 { return ResourceManager.GetString("XA4243", resourceCulture); } } - + /// /// Looks up a localized string similar to Attribute '{0}' cannot be empty for '{1}' item '{2}'.. /// @@ -1380,7 +1398,7 @@ public static string XA4244 { return ResourceManager.GetString("XA4244", resourceCulture); } } - + /// /// Looks up a localized string similar to Specified POM file '{0}' does not exist.. /// @@ -1389,7 +1407,7 @@ public static string XA4245 { return ResourceManager.GetString("XA4245", resourceCulture); } } - + /// /// Looks up a localized string similar to Could not parse POM file '{0}'. ///- {1}. @@ -1399,7 +1417,7 @@ public static string XA4246 { return ResourceManager.GetString("XA4246", resourceCulture); } } - + /// /// Looks up a localized string similar to Could not resolve POM file for artifact '{0}'.. /// @@ -1408,7 +1426,7 @@ public static string XA4247 { return ResourceManager.GetString("XA4247", resourceCulture); } } - + /// /// Looks up a localized string similar to Could not find NuGet package '{0}' version '{1}' in lock file. Ensure NuGet Restore has run since this <PackageReference> was added.. /// @@ -1417,7 +1435,7 @@ public static string XA4248 { return ResourceManager.GetString("XA4248", resourceCulture); } } - + /// /// Looks up a localized string similar to Maven artifact specification '{0}' is invalid. The correct format is 'group_id:artifact_id:version'.. /// @@ -1426,7 +1444,7 @@ public static string XA4249 { return ResourceManager.GetString("XA4249", resourceCulture); } } - + /// /// Looks up a localized string similar to Native library '{0}' will not be bundled because it has an unsupported ABI. Move this file to a directory with a valid Android ABI name such as 'libs/armeabi-v7a/'.. /// @@ -1435,7 +1453,7 @@ public static string XA4300 { return ResourceManager.GetString("XA4300", resourceCulture); } } - + /// /// Looks up a localized string similar to APK already contains the item {0}; ignoring.. /// @@ -1444,7 +1462,7 @@ public static string XA4301 { return ResourceManager.GetString("XA4301", resourceCulture); } } - + /// /// Looks up a localized string similar to Cannot determine ABI of native library '{0}'. Move this file to a directory with a valid Android ABI name such as 'libs/armeabi-v7a/'.. /// @@ -1453,7 +1471,7 @@ public static string XA4301_ABI { return ResourceManager.GetString("XA4301_ABI", resourceCulture); } } - + /// /// Looks up a localized string similar to Could not determine ABI of some native libraries. Ignoring those: {0}. /// @@ -1462,7 +1480,7 @@ public static string XA4301_ABI_Ignoring { return ResourceManager.GetString("XA4301_ABI_Ignoring", resourceCulture); } } - + /// /// Looks up a localized string similar to Cannot determine ABI of native library '{0}'. Remove the '{1}' NuGet package, or notify the library author.. /// @@ -1471,7 +1489,7 @@ public static string XA4301_ABI_NuGet { return ResourceManager.GetString("XA4301_ABI_NuGet", resourceCulture); } } - + /// /// Looks up a localized string similar to Unhandled exception merging `AndroidManifest.xml`: {0}. /// @@ -1480,7 +1498,7 @@ public static string XA4302 { return ResourceManager.GetString("XA4302", resourceCulture); } } - + /// /// Looks up a localized string similar to Error extracting resources from "{0}": {1}. /// @@ -1489,7 +1507,7 @@ public static string XA4303 { return ResourceManager.GetString("XA4303", resourceCulture); } } - + /// /// Looks up a localized string similar to ProGuard configuration file '{0}' was not found.. /// @@ -1498,7 +1516,7 @@ public static string XA4304 { return ResourceManager.GetString("XA4304", resourceCulture); } } - + /// /// Looks up a localized string similar to Multidex is enabled, but `$(_AndroidMainDexListFile)` is empty.. /// @@ -1507,7 +1525,7 @@ public static string XA4305 { return ResourceManager.GetString("XA4305", resourceCulture); } } - + /// /// Looks up a localized string similar to Multidex is enabled, but the `$(_AndroidMainDexListFile)` file '{0}' does not exist.. /// @@ -1516,7 +1534,7 @@ public static string XA4305_File_Missing { return ResourceManager.GetString("XA4305_File_Missing", resourceCulture); } } - + /// /// Looks up a localized string similar to R8 does not support `@(MultiDexMainDexList)` files when android:minSdkVersion >= 21. /// @@ -1525,7 +1543,7 @@ public static string XA4306 { return ResourceManager.GetString("XA4306", resourceCulture); } } - + /// /// Looks up a localized string similar to Invalid ProGuard configuration file. {0}. /// @@ -1534,7 +1552,7 @@ public static string XA4307 { return ResourceManager.GetString("XA4307", resourceCulture); } } - + /// /// Looks up a localized string similar to Failed to generate type maps. /// @@ -1543,7 +1561,7 @@ public static string XA4308 { return ResourceManager.GetString("XA4308", resourceCulture); } } - + /// /// Looks up a localized string similar to 'MultiDexMainDexList' file '{0}' does not exist.. /// @@ -1552,7 +1570,7 @@ public static string XA4309 { return ResourceManager.GetString("XA4309", resourceCulture); } } - + /// /// Looks up a localized string similar to `{0}` file `{1}` could not be found.. /// @@ -1561,7 +1579,7 @@ public static string XA4310 { return ResourceManager.GetString("XA4310", resourceCulture); } } - + /// /// Looks up a localized string similar to The application won't contain the paired Wear package because the Wear application package APK is not created yet. If building on the command line, be sure to build the "SignAndroidPackage" target.. /// @@ -1570,7 +1588,7 @@ public static string XA4311 { return ResourceManager.GetString("XA4311", resourceCulture); } } - + /// /// Looks up a localized string similar to Referencing the Android Wear application project '{0}' from an Android application project is deprecated and will no longer be supported in a future version of .NET for Android. Remove the Android Wear application project reference from the Android application project and distribute the Wear application as a standalone application instead.. /// @@ -1579,7 +1597,7 @@ public static string XA4312 { return ResourceManager.GetString("XA4312", resourceCulture); } } - + /// /// Looks up a localized string similar to The built-in '{0}' reference has been deprecated. ///Remove the '{0}' reference from your project and add the '{1}' NuGet package instead. @@ -1590,7 +1608,7 @@ public static string XA4313 { return ResourceManager.GetString("XA4313", resourceCulture); } } - + /// /// Looks up a localized string similar to `{0}` is empty. A value for `{0}` should be provided.. /// @@ -1599,7 +1617,7 @@ public static string XA4314 { return ResourceManager.GetString("XA4314", resourceCulture); } } - + /// /// Looks up a localized string similar to Ignoring `{0}`. Manifest does not have the required 'package' attribute on the manifest element.. /// @@ -1608,7 +1626,7 @@ public static string XA4315 { return ResourceManager.GetString("XA4315", resourceCulture); } } - + /// /// Looks up a localized string similar to Missing Android NDK toolchains directory '{0}'. Please install the Android NDK.. /// @@ -1617,7 +1635,7 @@ public static string XA5101 { return ResourceManager.GetString("XA5101", resourceCulture); } } - + /// /// Looks up a localized string similar to C compiler for target {0} was not found. Tried paths: "{1}". /// @@ -1626,7 +1644,7 @@ public static string XA5101_C_Compiler { return ResourceManager.GetString("XA5101_C_Compiler", resourceCulture); } } - + /// /// Looks up a localized string similar to Toolchain directory for target {0} was not found.. /// @@ -1635,7 +1653,7 @@ public static string XA5101_Toolchain { return ResourceManager.GetString("XA5101_Toolchain", resourceCulture); } } - + /// /// Looks up a localized string similar to Could not locate the Android NDK. Please make sure the Android NDK is installed in the Android SDK Manager, or if using a custom NDK path, please ensure the $(AndroidNdkDirectory) MSBuild property is set to the custom path.. /// @@ -1644,7 +1662,7 @@ public static string XA5104 { return ResourceManager.GetString("XA5104", resourceCulture); } } - + /// /// Looks up a localized string similar to Toolchain utility '{0}' for target {1} was not found. Tried in path: "{2}". /// @@ -1653,7 +1671,7 @@ public static string XA5105 { return ResourceManager.GetString("XA5105", resourceCulture); } } - + /// /// Looks up a localized string similar to Cannot find `{0}`. Please install the Android SDK Build-Tools package with the `{1}{2}tools{2}{3}` program.. /// @@ -1662,7 +1680,7 @@ public static string XA5205 { return ResourceManager.GetString("XA5205", resourceCulture); } } - + /// /// Looks up a localized string similar to Cannot find `{0}` in the Android SDK. Please set its path via /p:LintToolPath.. /// @@ -1671,7 +1689,7 @@ public static string XA5205_Lint { return ResourceManager.GetString("XA5205_Lint", resourceCulture); } } - + /// /// Looks up a localized string similar to Could not find android.jar for API level {0}. This means the Android SDK platform for API level {0} is not installed; it was expected to be in `{1}`. ///{2} @@ -1682,7 +1700,7 @@ public static string XA5207 { return ResourceManager.GetString("XA5207", resourceCulture); } } - + /// /// Looks up a localized string similar to You can install the missing API level by running `dotnet build -t:InstallAndroidDependencies -f {0} "-p:AndroidSdkDirectory={1}"`, or change the project to target an API version that is installed.. /// @@ -1691,7 +1709,7 @@ public static string XA5207_SDK_Manager_CLI { return ResourceManager.GetString("XA5207_SDK_Manager_CLI", resourceCulture); } } - + /// /// Looks up a localized string similar to Either install it in the Android SDK Manager (Tools > Android > Android SDK Manager...), or change the .NET for Android project to target an API version that is installed.. /// @@ -1700,7 +1718,7 @@ public static string XA5207_SDK_Manager_Windows { return ResourceManager.GetString("XA5207_SDK_Manager_Windows", resourceCulture); } } - + /// /// Looks up a localized string similar to Embedded Wear app package name differs from handheld app package name ({0} != {1}).. /// @@ -1709,7 +1727,7 @@ public static string XA5211 { return ResourceManager.GetString("XA5211", resourceCulture); } } - + /// /// Looks up a localized string similar to java.lang.OutOfMemoryError. Consider increasing the value of $(JavaMaximumHeapSize). Java ran out of memory while executing '{0} {1}'. /// @@ -1718,7 +1736,7 @@ public static string XA5213 { return ResourceManager.GetString("XA5213", resourceCulture); } } - + /// /// Looks up a localized string similar to No Android platforms installed at '{0}'. Please install an SDK Platform with the `{1}{2}tools{2}{3}` program.. /// @@ -1727,7 +1745,7 @@ public static string XA5300_Android_Platforms { return ResourceManager.GetString("XA5300_Android_Platforms", resourceCulture); } } - + /// /// Looks up a localized string similar to The Android SDK directory could not be found. Install the Android SDK by following the instructions at: https://aka.ms/dotnet-android-install-sdk ///To use a custom SDK path for a command line build, set the 'AndroidSdkDirectory' MSBuild property to the custom path.. @@ -1737,7 +1755,7 @@ public static string XA5300_Android_SDK { return ResourceManager.GetString("XA5300_Android_SDK", resourceCulture); } } - + /// /// Looks up a localized string similar to The Java SDK directory could not be found. Install the Java SDK by following the instructions at: https://aka.ms/dotnet-android-install-sdk ///To use a custom JDK path for a command line build, set the 'JavaSdkDirectory' MSBuild property to the custom path.. @@ -1747,7 +1765,7 @@ public static string XA5300_Java_SDK { return ResourceManager.GetString("XA5300_Java_SDK", resourceCulture); } } - + /// /// Looks up a localized string similar to Failed to generate Java type for class: {0} due to MAX_PATH: {1}. /// @@ -1756,7 +1774,7 @@ public static string XA5301 { return ResourceManager.GetString("XA5301", resourceCulture); } } - + /// /// Looks up a localized string similar to Two processes may be building this project at once. Lock file exists at path: {0}. /// @@ -1765,7 +1783,7 @@ public static string XA5302 { return ResourceManager.GetString("XA5302", resourceCulture); } } - + /// /// Looks up a localized string similar to Could not find Android Resource '{0}'. Please update @(AndroidResource) to add the missing resource.. /// @@ -1774,7 +1792,7 @@ public static string XA8000 { return ResourceManager.GetString("XA8000", resourceCulture); } } - + /// /// Looks up a localized string similar to Executable 'gradlew' not found in project directory '{0}'. Please ensure the path to your Gradle project folder is correct, and that it contains Gradle Wrapper scripts.. /// @@ -1783,7 +1801,7 @@ public static string XAGRDL1000 { return ResourceManager.GetString("XAGRDL1000", resourceCulture); } } - + /// /// Looks up a localized string similar to Adding reference to Gradle output: '{0}'. The '%(CreateAndroidLibrary)' metadata can be set to 'false' to opt out of this behavior.. /// diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx index d1ee02dc051..d1f9268f5ba 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx @@ -1009,6 +1009,14 @@ To use a custom JDK path for a command line build, set the 'JavaSdkDirectory' MS {1} - The current value of the property + + The <instrumentation> element in AndroidManifest.xml is missing the android:name attribute. + The following are literal names and should not be translated: AndroidManifest.xml, android:name, instrumentation. + + + No <instrumentation> element found in AndroidManifest.xml. + The following are literal names and should not be translated: AndroidManifest.xml, instrumentation. + Java dependency '{0}' is not satisfied. The following are literal names and should not be translated: Java. diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/GetAndroidInstrumentationName.cs b/src/Xamarin.Android.Build.Tasks/Tasks/GetAndroidInstrumentationName.cs new file mode 100644 index 00000000000..bfb36e45566 --- /dev/null +++ b/src/Xamarin.Android.Build.Tasks/Tasks/GetAndroidInstrumentationName.cs @@ -0,0 +1,34 @@ +#nullable enable +using Microsoft.Build.Framework; +using Xamarin.Android.Tools; +using Microsoft.Android.Build.Tasks; + +namespace Xamarin.Android.Tasks +{ + /// + /// Finds the first <instrumentation> element in an AndroidManifest.xml + /// and returns its android:name attribute value. + /// + public class GetAndroidInstrumentationName : AndroidTask + { + public override string TaskPrefix => "GAIN"; + + [Required] + public string ManifestFile { get; set; } = ""; + + [Output] + public string? InstrumentationName { get; set; } + + public override bool RunTask () + { + var manifest = AndroidAppManifest.Load (ManifestFile, MonoAndroidHelper.SupportedVersions); + var androidNs = AndroidAppManifest.AndroidXNamespace; + var doc = manifest.Document; + + var instrumentation = doc?.Root?.Element (androidNs + "instrumentation"); + InstrumentationName = instrumentation?.Attribute (androidNs + "name")?.Value; + + return !Log.HasLoggedErrors; + } + } +} diff --git a/tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs b/tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs index 04e52ee9839..3b50c835a7b 100644 --- a/tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs +++ b/tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs @@ -2233,6 +2233,84 @@ public void StartAndroidActivityRespectsAndroidDeviceUserId () "The 'am start' command should contain '--user 0' when AndroidDeviceUserId is set."); } + [Test] + public void DotNetNewAndroidTest () + { + var templateName = TestName; + var projectDirectory = Path.Combine (Root, "temp", templateName); + if (Directory.Exists (projectDirectory)) + Directory.Delete (projectDirectory, true); + + TestOutputDirectories [TestContext.CurrentContext.Test.ID] = projectDirectory; + var dotnet = new DotNetCLI (Path.Combine (projectDirectory, $"{templateName}.csproj")); + Assert.IsTrue (dotnet.New ("androidtest"), "`dotnet new androidtest` should succeed"); + + // Build and assert 0 warnings + Assert.IsTrue (dotnet.Build (), "`dotnet build` should succeed"); + dotnet.AssertHasNoWarnings (); + + // Run instrumentation via `dotnet run` and capture output + using var process = dotnet.StartRun (waitForExit: true); + + var locker = new Lock (); + var output = new StringBuilder (); + + process.OutputDataReceived += (sender, e) => { + if (e.Data != null) + lock (locker) + output.AppendLine (e.Data); + }; + process.ErrorDataReceived += (sender, e) => { + if (e.Data != null) + lock (locker) + output.AppendLine ($"STDERR: {e.Data}"); + }; + + process.BeginOutputReadLine (); + process.BeginErrorReadLine (); + + // Wait for the process to complete (instrumentation should finish on its own) + bool completed = process.WaitForExit ((int) TimeSpan.FromMinutes (5).TotalMilliseconds); + if (!completed) { + try { process.Kill (entireProcessTree: true); } catch { } + } else { + // Ensure async output events are fully drained + process.WaitForExit (); + } + + // Write the output to a log file for debugging + string logPath = Path.Combine (projectDirectory, "dotnet-run-output.log"); + File.WriteAllText (logPath, output.ToString ()); + TestContext.AddTestAttachment (logPath); + + Assert.IsTrue (completed, $"`dotnet run` did not complete in time. See {logPath} for details."); + + // Parse INSTRUMENTATION_RESULT lines from output + var outputText = output.ToString (); + int passed = ParseInstrumentationResult (outputText, "passed"); + int failed = ParseInstrumentationResult (outputText, "failed"); + int skipped = ParseInstrumentationResult (outputText, "skipped"); + + Assert.AreEqual (1, passed, $"Expected 1 passed test, got {passed}. See {logPath} for details."); + Assert.AreEqual (1, failed, $"Expected 1 failed test, got {failed}. See {logPath} for details."); + Assert.AreEqual (1, skipped, $"Expected 1 skipped test, got {skipped}. See {logPath} for details."); + } + + static int ParseInstrumentationResult (string output, string key) + { + // Parses lines like: INSTRUMENTATION_RESULT: passed=1 + var prefix = $"INSTRUMENTATION_RESULT: {key}="; + foreach (var rawLine in output.Split ('\n')) { + var line = rawLine.Trim (); + if (line.StartsWith (prefix, StringComparison.Ordinal)) { + var valueStr = line.Substring (prefix.Length).Trim (); + if (int.TryParse (valueStr, out int value)) + return value; + } + } + return -1; + } + static string GetAppHelperSource (string appHelperBody, string hotReloadMessage) => $$""" using System;