{"record":{"id":"d6c81773ef0bcdc6","repo":"apache/cordova-android","slug":"requirements-check-failed-for-android-sdk-android","errorCode":null,"errorMessage":"Requirements check failed for Android SDK! Android SDK was not detected.","messagePattern":"Requirements check failed for Android SDK! Android SDK was not detected\\.","errorType":"exception","errorClass":"CordovaError","httpStatus":null,"severity":"error","filePath":"lib/check_reqs.js","lineNumber":278,"sourceCode":"    return android_sdk.list_targets().then(function (targets) {\n        if (targets.indexOf(desired_api_level) >= 0) {\n            return targets;\n        }\n        throw new CordovaError(`Please install the Android SDK Platform \"platforms;${desired_api_level}\"`);\n    });\n};\n\n// Returns a promise.\nmodule.exports.run = function () {\n    console.log('Checking Java JDK and Android SDK versions');\n    console.log('ANDROID_HOME=' + process.env.ANDROID_HOME + ' (recommended setting)');\n    console.log('ANDROID_SDK_ROOT=' + process.env.ANDROID_SDK_ROOT + ' (DEPRECATED)');\n\n    return Promise.all([this.check_java(), this.check_android()]).then(function (values) {\n        console.log('Using Android SDK: ' + (process.env.ANDROID_HOME || process.env.ANDROID_SDK_ROOT));\n\n        if (!values[1]) {\n            throw new CordovaError('Requirements check failed for Android SDK! Android SDK was not detected.');\n        }\n    });\n};\n\n/**\n * Object thar represents one of requirements for current platform.\n * @param {String} id         The unique identifier for this requirements.\n * @param {String} name       The name of requirements. Human-readable field.\n * @param {String} version    The version of requirement installed. In some cases could be an array of strings\n *                            (for example, check_android_target returns an array of android targets installed)\n * @param {Boolean} installed Indicates whether the requirement is installed or not\n */\nconst Requirement = function (id, name, version, installed) {\n    this.id = id;\n    this.name = name;\n    this.installed = installed || false;\n    this.metadata = {\n        version","sourceCodeStart":260,"sourceCodeEnd":296,"githubUrl":"https://github.com/apache/cordova-android/blob/7c1e190064e349ffa4bbc6ac37b77cd773e4dbd3/lib/check_reqs.js#L260-L296","documentation":"Summary error from check_reqs.run(): it resolves Promise.all([check_java(), check_android()]) and throws when values[1] (check_android's result) is falsy, meaning the SDK detection chain produced no usable Android SDK. `cordova requirements android` surfaces exactly this line when the SDK row fails.","triggerScenarios":"`cordova requirements android` (or any consumer of check_reqs.run) when check_android resolves falsy - which is always downstream of one of the detection failures in the same file (unset ANDROID_HOME with no inferable tools, non-existent ANDROID_HOME path, etc.).","commonSituations":"CI container without Android env vars; a machine where ANDROID_HOME was typo'd; the final state after any of the check_android branches failed to establish a valid SDK root.","solutions":["Re-run `cordova requirements android` and read the earlier ANDROID_HOME-specific error it prints - fix that one (set ANDROID_HOME, fix its path, install cmdline-tools).","Install the SDK and export ANDROID_HOME/ANDROID_SDK_ROOT plus PATH entries for platform-tools and cmdline-tools.","Confirm the fix with `cordova requirements android` until all rows pass."],"exampleFix":"# before\n$ cordova requirements android\nRequirements check failed for Android SDK! Android SDK was not detected.\n\n# after\nexport ANDROID_HOME=\"$HOME/Android/Sdk\"\nexport PATH=\"$ANDROID_HOME/platform-tools:$ANDROID_HOME/cmdline-tools/latest/bin:$PATH\"\n$ cordova requirements android","handlingStrategy":"validation","validationCode":"const [javaOk, androidOk] = await Promise.all([check_reqs.check_java(), check_reqs.check_android()]);\nif (!androidOk) {\n  throw new Error('Android SDK not detected - set ANDROID_HOME and rerun `cordova requirements android`');\n}","typeGuard":null,"tryCatchPattern":"try {\n  await check_reqs.run();\n} catch (e) {\n  if (/Android SDK was not detected/.test(e.message)) {\n    // re-run check_android alone to surface the specific ANDROID_HOME error, then guide setup\n  }\n  throw e;\n}","preventionTips":["Treat `cordova requirements android` as a required gate in CI before build jobs.","Fix root cause (ANDROID_HOME / SDK presence) rather than skipping the requirements step."],"tags":["android-sdk","requirements-check","android-home","diagnostics"],"backgroundTag":"sdk-not-detected","analyzedSha":"7c1e190064e349ffa4bbc6ac37b77cd773e4dbd3","analyzedAt":"2026-08-22T04:57:58.868Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}