{"record":{"id":"42807ab4266a7068","repo":"dotnet/maui","slug":"ui-test-application-path-not-specified","errorCode":null,"errorMessage":"UI Test application path not specified.","messagePattern":"UI Test application path not specified\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"eng/devices/android.cake","lineNumber":244,"sourceCode":"\t\t\t// CopyFile(testApp, new DirectoryPath(resultsDir).CombineWithFilePath(new FilePath(testApp).GetFilename()));\n\t\t}\n\n\t\tHandleTestResults(resultsDir, testsFailed, false);\n\t}\n\n\tInformation(\"Testing completed.\");\n}\n\nvoid ExecutePrepareUITests(string project, string app, string appPackageName, string device, string resultsDir, string binDir, string config, string tfm, string rid, string ver, string toolPath, string instrumentation, bool headless)\n{\n\tstring platform = \"android\";\n\tInformation(\"Preparing UI Tests...\");\n\n\tvar testApp = GetTestApplications(app, device, config, tfm, \"\").FirstOrDefault();\n\n\tif (string.IsNullOrEmpty(testApp))\n\t{\n\t\tthrow new Exception(\"UI Test application path not specified.\");\n\t}\n\tif (string.IsNullOrEmpty(appPackageName))\n\t{\n\t\tvar appFile = new FilePath(testApp);\n\t\tappFile = appFile.GetFilenameWithoutExtension();\n\t\tappPackageName = appFile.FullPath.Replace(\"-Signed\", \"\");\n\t}\n\tif (string.IsNullOrEmpty(instrumentation))\n\t{\n\t\tinstrumentation = appPackageName + \".TestInstrumentation\";\n\t}\n\n\tInformation(\"Test App: {0}\", testApp);\n\tInformation(\"Test App Package Name: {0}\", appPackageName);\n\tInformation(\"Test Results Directory: {0}\", resultsDir);\n\tInformation($\"Testing Device: {device}\");\n\tInformation($\"Testing App Project: {app}\");\n\tInformation($\"Testing App: {testApp}\");","sourceCodeStart":226,"sourceCodeEnd":262,"githubUrl":"https://github.com/dotnet/maui/blob/f377ff1c5ee04d334d8a925f50c83a6b7afddf03/eng/devices/android.cake#L226-L262","documentation":"Thrown by ExecutePrepareUITests (Android) when GetTestApplications returns no application path for the given app/device/config/tfm inputs. The test app binary (.apk) could not be located, so UI test preparation cannot proceed.","triggerScenarios":"GetTestApplications(app, device, config, tfm, \"\").FirstOrDefault() returns null/empty — i.e. no built .apk matches the supplied app path, configuration, TFM, or rid arguments/environment variables.","commonSituations":"The TestCases.Android app was never built before running the UI test target; the ANDROID_TEST_APP / app argument points at a stale or wrong directory; config/tfm mismatch between the build step and the test step (e.g. built for android31.0 but querying android34.0).","solutions":["Build the TestCases.Android app first with the same configuration and TFM that the test step expects.","Set ANDROID_TEST_APP (or pass --app=<path>) to the directory containing the -Signed.apk, or build it so GetTestApplications can discover it.","Verify config, tfm, and rid arguments match between the build and the UI-test invocation."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"var apps = GetTestApplications(app, device, config, tfm, \"\");\nif (!apps.Any())\n    throw new Exception($\"No Android test app found for app='{app}', config='{config}', tfm='{tfm}'. Build the app first.\");\nvar testApp = apps.First();","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Build the TestCases.Android app in a prior step with matching config/TFM.","Set ANDROID_TEST_APP explicitly to remove discovery ambiguity.","Align config/tfm/rid between build and test steps in CI."],"tags":["android","ui-tests","test-app","build-artifact","cake"],"backgroundTag":null,"analyzedSha":"f377ff1c5ee04d334d8a925f50c83a6b7afddf03","analyzedAt":"2026-08-13T14:26:18.069Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}