Errors building Android on Win10 - Version is not a command

I’ve started getting an error that Version is not a recognized command when trying to build for Android on Windows 10. meteor-tool\2.5.1\mt-os.windows.x86_64\tools\cordova\project.js tries to run a file called version in cordova-build\platforms\android\cordova. Version is a short javascript file,m but has no extension and is being launched without node.exe. I had the same problem with meteor-tool 2.5.0. Is there supposed to be another version.bat file or something getting placed into android\cordova for windows builds?

Has anyone run into something like this before?


Error: Command failed: C:\meteor\place3\.meteor\local\cordova-build\platforms\android\cordova\version
'C:\meteor\place3\.meteor\local\cordova-build\platforms\android\cordova\version' is not recognized as an internal or external command,
operable program or batch file.
    at ChildProcess.exitCallback (C:\Users\chris\AppData\Local\.meteor\packages\meteor-tool\2.5.1\mt-os.windows.x86_64\tools\utils\tools\utils\processes.ts:174:23)
    at ChildProcess.emit (events.js:412:35)
    at maybeClose (internal/child_process.js:1058:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:293:5)
 => awaited here:
    at Function.Promise.await (C:\Users\chris\AppData\Local\.meteor\packages\meteor-tool\2.5.1\mt-os.windows.x86_64\dev_bundle\lib\node_modules\meteor-promise\promise_server.js:56:12)
    at execFileSync (C:\Users\chris\AppData\Local\.meteor\packages\meteor-tool\2.5.1\mt-os.windows.x86_64\tools\utils\tools\utils\processes.ts:60:24)
    at CordovaProject.installedVersionForPlatform (C:\tools\cordova\project.js:434:9)
    at C:\tools\cordova\project.js:135:39
    at Function.some (C:\Users\chris\AppData\Local\.meteor\packages\meteor-tool\2.5.1\mt-os.windows.x86_64\dev_bundle\lib\node_modules\underscore\underscore-node-f-pre.js:1406:9)
    at CordovaProject.createIfNeeded (C:\tools\cordova\project.js:129:26)
    at new CordovaProject (C:\tools\cordova\project.js:118:10)
    at C:\tools\cli\commands.js:419:32
    at Object.capture (C:\tools\utils\buildmessage.js:283:5)
    at Object.main.captureAndExit (C:\tools\cli\main.js:279:29)
    at prepareCordovaProject (C:\tools\cli\commands.js:418:12)
    at Command.doRunCommand [as func] (C:\tools\cli\commands.js:433:5)
    at C:\tools\cli\main.js:1534:15 {
  pid: 4372,
  stdout: '',
  stderr: "'C:\\meteor\\place3\\.meteor\\local\\cordova-build\\platforms\\android\\cordova\\version' is not recognized as an internal or external command,\r\n" +
    'operable program or batch file.',
  status: 1,
  signal: null
}

Hello. Same case for me. But instead of

… is not recognized as an internal or external command, operable program or batch file.

I’ve get an message with unknown encoding chars

... \.meteor\local\cordova-build\platforms\android\cordova\version" �� ���� ����७��� ��� ���譥� ��������, �ᯮ��塞�� �ணࠬ��� ��� ������ 䠩���.
...

And judging by position of this chars my error message is little different. Or… I don’t know. Wait for help

Good news.

  1. This kind of error (about version file) appears only after previous unsuccessful build. So it isn’t represent the real cause of trouble.
  2. To make clear rebuild and see the real error we need to remove “/.meteor/local/cordova-build” folder every time before build/run (if previous build failed).
  3. Then we will see the root trouble and fix it. In most cases (and my case) it is setup of Android SDK, Gradle and environment variables.

I’ve solve it by install all requirements for API-30 (not lower or higher) via SDK Manager. Also now we need the Command-line Tools package, and provide “…\Android\Sdk\cmdline-tools\latest\bin” to the PATH.

Thank you. I’ll check my versions.