Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-7299

Hard to diagnose message when ANDROID_HOME env variable missing

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • None

    Description

      When ANDROID_HOME env variable not set then then following output is produced:

      Running command: C:\<projectdir>\platforms\android\cordova\run.bat
      Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre8\lib\tools.jar
      Buildfile: C:\<projectdir>\platforms\android\build.xml
      BUILD FAILED
      
      C:\<projectdir>\platforms\android\build.xml:90: Cannot find C:\Users\<user>\AppData\Local\Android\android-sdk\
      tools\ant\build.xml imported from C:\<projectdir>\platforms\android\build.xml
      Total time: 2 seconds
      C:\<projectdir>\platforms\android\cordova\node_modules\q\q.js:126
                          throw e;
                                ^
      Error code 1 for command: cmd with args: /s,/c,ant,debug,-f,C:\<projectdir>\platforms\android\build.xml,-Dou
      t.dir=ant-build,-Dgen.absolute.dir=ant-gen
      Error: C:\<projectdir>\platforms\android\cordova\run.bat: Command failed with exit code 8
          at ChildProcess.whenDone (C:\Users\<user>\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordov
      a\superspawn.js:135:23)
          at ChildProcess.emit (events.js:98:17)
          at maybeClose (child_process.js:756:16)
          at Process.ChildProcess._handle.onexit (child_process.js:823:5)
      

      Expected to be more user friendly error message:

      Error: ANDROID_HOME variable should set before running `cordova run android`
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            akurdyumov Andrey Kurdyumov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: