{"record":{"id":"e6cbc93adbd5e3a1","repo":"apache/cordova-android","slug":"package-type-bundle-is-not-supported-during-cord","errorCode":null,"errorMessage":"Package type \"bundle\" is not supported during cordova run.","messagePattern":"Package type \"bundle\" is not supported during cordova run\\.","errorType":"validation","errorClass":"CordovaError","httpStatus":null,"severity":"error","filePath":"lib/run.js","lineNumber":65,"sourceCode":"    return `${type} ${id}`;\n}\n\n/**\n * Runs the application on a device if available. If no device is found, it will\n *   use a started emulator. If no started emulators are found it will attempt\n *   to start an avd. If no avds are found it will error out.\n *\n * @param   {Object}  runOptions  various run/build options. See Api.js build/run\n *   methods for reference.\n *\n * @return  {Promise}\n */\nmodule.exports.run = async function (runOptions = {}) {\n    const { packageType, buildType } = build.parseBuildOptions(runOptions, null, this.root);\n\n    // Android app bundles cannot be deployed directly to the device\n    if (packageType === PackageType.BUNDLE) {\n        throw new CordovaError('Package type \"bundle\" is not supported during cordova run.');\n    }\n\n    const buildResults = this._builder.fetchBuildResults(buildType);\n    if (buildResults.apkPaths.length === 0) {\n        throw new CordovaError('Could not find any APKs to deploy');\n    }\n\n    const targetSpec = buildTargetSpec(runOptions);\n    const resolvedTarget = await target.resolve(targetSpec, buildResults);\n    events.emit('log', `Deploying to ${formatResolvedTarget(resolvedTarget)}`);\n\n    if (resolvedTarget.type === 'emulator') {\n        await emulator.wait_for_boot(resolvedTarget.id);\n    }\n\n    const manifest = new AndroidManifest(this.locations.manifest);\n    const cordovaGradleConfigParser = CordovaGradleConfigParserFactory.create(this.locations.root);\n","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/apache/cordova-android/blob/7c1e190064e349ffa4bbc6ac37b77cd773e4dbd3/lib/run.js#L47-L83","documentation":"cordova run android refuses to deploy when the build options resolve to packageType 'bundle'. Android App Bundles (.aab) are a Play Store upload format that a device cannot install; only APKs can be pushed via adb, so run aborts before looking for build outputs.","triggerScenarios":"Running `cordova run android -- --packageType=bundle`, or having packageType=bundle stored in build.json (the --buildConfig file) / set as a persistent preference, so build.parseBuildOptions yields BUNDLE during run.","commonSituations":"Copy-pasting release build commands (which legitimately use --packageType=bundle for Play uploads) into a run/deploy workflow; a build.json used for both CI artifact generation and local device testing.","solutions":["Drop --packageType=bundle for deployment: `cordova run android` (defaults to apk)","If using a buildConfig, point run at a config without packageType=bundle: `cordova run android --buildConfig=build.dev.json`","Keep bundle for release artifacts only: `cordova build android --release -- --packageType=bundle` produces the .aab for Play Store upload"],"exampleFix":"# before\ncordova run android --release -- --packageType=bundle\n\n# after\ncordova build android --release -- --packageType=bundle   # produce .aab for Play\ncordova run android --release                             # deploy apk to device","handlingStrategy":"validation","validationCode":"// guard deploy scripts against bundle configuration\nconst opts = parseArgs();\nif (opts.packageType === 'bundle' && argv._.includes('run')) {\n  throw new Error('packageType=bundle cannot be deployed; use default apk for run');\n}","typeGuard":null,"tryCatchPattern":"try { await cordova.run('android', runOptions); } catch (e) {\n  if (/Package type \"bundle\" is not supported during cordova run/.test(e.message)) { /* strip packageType and rebuild+run as apk */ }\n}","preventionTips":["Keep release-bundle commands separate from run/deploy commands in scripts","Default to apk in shared build.json; override to bundle only for Play Store artifact builds"],"tags":["cordova","cordova-android","run","app-bundle","deployment"],"backgroundTag":"unsupported-build-option","analyzedSha":"7c1e190064e349ffa4bbc6ac37b77cd773e4dbd3","analyzedAt":"2026-08-22T04:57:58.868Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}