Skip to content

Android build error when space exists in the folder #1213

Closed

Description

@stevetayloruk

Hi,

I'm getting an error when trying to run:

tns run android --emulator

The error seems to be related to a space in a folder within the project path.

'c:\Avastec' is not recognized as an internal or external command,
operable program or batch file.

The path is meant to be:

c:\avastec projects\app\

thanks

Steve

Activity

  1. teobugslayer commented on Dec 7, 2015

    @teobugslayer

    Please run the command with additional logging, like tns run android --emulator --log trace > log.txt and send us the log file. This will speed up finding the issue. Thanks in advance!

  2. stevetayloruk commented on Dec 8, 2015

    @stevetayloruk
    Author

    execFile: C:\Program Files (x86)\Android\android-sdk\platform-tools\adb "help"
    spawn: C:\Program Files (x86)\Android\android-sdk\tools\android.bat "--help"

       Usage:
       android [global options] action [action options]
       Global options:
    

    -s --silent : Silent mode, shows errors only.
    -v --verbose : Verbose mode, shows errors, warnings and all messages.
    --clear-cache: Clear the SDK Manager repository manifest cache.
    -h --help : Help on a specific command.

                                                                    Valid
                                                                    actions
                                                                    are
                                                                    composed
                                                                    of a verb
                                                                    and an
                                                                    optional
                                                                    direct
                                                                    object:
    
    • sdk : Displays the SDK Manager window.
    • avd : Displays the AVD Manager window.
    • list : Lists existing targets or virtual devices.
    • list avd : Lists existing Android Virtual Devices.
    • list target : Lists existing targets.
    • list device : Lists existing devices.
    • list sdk : Lists remote SDK repository.
    • create avd : Creates a new Android Virtual Device.
    • move avd : Moves or renames an Android Virtual Device.
    • delete avd : Deletes an Android Virtual Device.
    • update avd : Updates an Android Virtual Device to match the folders
      of a new SDK.
    • create project : Creates a new Android project.
    • update project : Updates an Android project (must already have an
      AndroidManifest.xml).
    • create test-project : Creates a new Android project for a test package.
    • update test-project : Updates the Android project for a test package (must
      already have an AndroidManifest.xml).
    • create lib-project : Creates a new Android library project.
    • update lib-project : Updates an Android library project (must already have
      an AndroidManifest.xml).
    • create uitest-project: Creates a new UI test project.
    • update adb : Updates adb to support the USB devices declared in the
      SDK add-ons.
    • update sdk : Updates the SDK by suggesting new platforms to install
      if available.

    Exec npm -v
    stdout: 2.14.7

    stderr:
    spawn: java "-version"
    Exec node-gyp -v
    stdout:
    stderr: 'node-gyp' is not recognized as an internal or external command,
    operable program or batch file.

    Exec "C:\Program Files (x86)\Android\android-sdk\platform-tools\adb" version
    stdout: Android Debug Bridge version 1.0.32
    Revision eac51f2bb6a8-android

    stderr:
    spawn: C:\Program Files (x86)\Android\android-sdk\tools\android.bat "-h"
    Exec mono --version
    stdout:
    stderr: 'mono' is not recognized as an internal or external command,
    operable program or batch file.

    Exec git --version
    stdout: git version 1.9.5.msysgit.1

    stderr:
    Exec gradle -v
    stdout:
    stderr: 'gradle' is not recognized as an internal or external command,
    operable program or batch file.

    Exec "C:\Program Files\Java\jdk1.8.0_66\bin\javac" -version
    stdout:
    stderr: The system cannot find the path specified.

    System information:
    { procInfo: 'nativescript/1.5.1',
    platform: 'win32',
    os: 'Windows 10 Pro 6.3.10586',
    shell: 'C:\WINDOWS\system32\cmd.exe',
    dotNetVer: '4.6.01038',
    procArch: 'x64',
    nodeVer: 'v4.2.1',
    npmVer: '2.14.7',
    javaVer: '1.8.0',
    nodeGypVer: null,
    xcodeVer: null,
    itunesInstalled: false,
    cocoapodVer: null,
    adbVer: 'Android Debug Bridge version 1.0.32',
    androidInstalled: true,
    monoVer: null,
    gitVer: '1.9.5.msysgit.1',
    gradleVer: null,
    javacVersion: null }
    Starting watch on killswitch C:\Users\Steve\AppData\Local\Temp\Steve\KillSwitches\cli
    Initializing analytics statuses.
    Analytics statuses:
    { TrackFeatureUsage: 1, TrackExceptions: 0 }
    Trying to track feature 'Non-interactive' with value 'run'.
    execFile: C:\Program Files (x86)\Android\android-sdk\platform-tools\adb "help"
    spawn: C:\Program Files (x86)\Android\android-sdk\platform-tools\adb "start-server"
    Looking for project in 'c:\Avastec Projects\raise-app'
    Project directory is 'c:\Avastec Projects\raise-app'.
    Analytics statuses:
    { TrackFeatureUsage: 1, TrackExceptions: 0 }
    Trying to track feature 'Non-interactive' with value 'run|android'.
    spawn: C:\Program Files (x86)\Android\android-sdk\tools\emulator "-help"
    execFile: C:\Program Files (x86)\Android\android-sdk\platform-tools\adb "devices"
    spawn: C:\Program Files (x86)\Android\android-sdk\platform-tools\adb "-s" "emulator-5554" "shell" "rm" "-rf" "/data/local/tmp/org.nativescript.raise/fullsync" "/data/local/tmp/org.nativescript.raise/sync" "/data/local/tmp/org.nativescript.raise/removedsync"
    Hooks directories: [ 'c:\Users\Steve\AppData\Roaming\npm\node_modules\nativescript\lib\hooks',
    'c:\Users\Steve\AppData\Roaming\npm\node_modules\nativescript\lib\common\hooks',
    'c:\Avastec Projects\raise-app\hooks' ]
    BeforeHookName for command prepare is before-prepare
    Project successfully prepared
    AfterHookName for command prepare is after-prepare
    Executing after-prepare hook from c:\Avastec Projects\raise-app\hooks\after-prepare\nativescript-dev-babel.js
    Executing after-prepare hook at location c:\Avastec Projects\raise-app\hooks\after-prepare\nativescript-dev-babel.js in-process
    Looking for c:\Avastec Projects\raise-app\platforms\android\src\main\assets*__.js
    Hook promises to signal completion
    Processing c:/Avastec Projects/raise-app/platforms/android/src/main/assets/app/app.js
    Processing c:/Avastec Projects/raise-app/platforms/android/src/main/assets/app/components/common/vm-base.js
    Processing c:/Avastec Projects/raise-app/platforms/android/src/main/assets/app/components/feed/feed-vm.js
    Processing c:/Avastec Projects/raise-app/platforms/android/src/main/assets/app/components/feed/feed.js
    Processing c:/Avastec Projects/raise-app/platforms/android/src/main/assets/app/components/forgotten-password/forgotten-password-vm.js
    Processing c:/Avastec Projects/raise-app/platforms/android/src/main/assets/app/components/forgotten-password/forgotten-password.js
    Processing c:/Avastec Projects/raise-app/platforms/android/src/main/assets/app/components/login/login-vm.js
    Processing c:/Avastec Projects/raise-app/platforms/android/src/main/assets/app/components/login/login.js
    Processing c:/Avastec Projects/raise-app/platforms/android/src/main/assets/app/components/services/auth-service.js
    Processing c:/Avastec Projects/raise-app/platforms/android/src/main/assets/app/components/services/data-service-base.js
    Processing c:/Avastec Projects/raise-app/platforms/android/src/main/assets/app/components/signup/signup-vm.js
    Processing c:/Avastec Projects/raise-app/platforms/android/src/main/assets/app/components/signup/signup.js
    Processing c:/Avastec Projects/raise-app/platforms/android/src/main/assets/app/components/splash/splash-vm.js
    Processing c:/Avastec Projects/raise-app/platforms/android/src/main/assets/app/components/splash/splash.js
    Processing complete
    Hook completed
    spawn: C:\Program Files (x86)\Android\android-sdk\tools\android.bat "list" "targets"

    Available Android targets:

    id: 1 or "android-19"
    Name: Android 4.4.2
    Type: Platform
    API level: 19
    Revision: 4
    Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in

    Tag/ABIs : default/armeabi-v7a, default/x86

    id: 2 or "android-21"
    Name: Android 5.0.1
    Type: Platform
    API level: 21
    Revision: 2
    Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in

    Tag/ABIs : no ABIs.

    id: 3 or "android-22"
    Name: Android 5.1.1
    Type: Platform
    API level: 22
    Revision: 2
    Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in

    Tag/ABIs : no ABIs.

    id: 4 or "android-23"
    Name: Android 6.0
    Type: Platform
    API level: 23
    Revision: 1
    Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in, AndroidWearRound, AndroidWearRound360x360, AndroidWearRound400x400, AndroidWearRound480x480, AndroidWearRoundChin320x290, AndroidWearRoundChin360x325, AndroidWearRoundChin360x330, AndroidWearSquare, AndroidWearSquare320x320

    Tag/ABIs : android-tv/armeabi-v7a, android-tv/x86, android-wear/x86, default/armeabi-v7a, default/x86, default/x86_64

    id: 5 or "Google Inc.:Google APIs:19"
    Name: Google APIs
    Type: Add-On
    Vendor: Google Inc.
    Revision: 17
    Description: Android + Google APIs
    Based on Android 4.4.2 (API level 19)
    Libraries:
    * com.android.future.usb.accessory (usb.jar)
    API for USB Accessories
    * com.google.android.media.effects (effects.jar)
    Collection of video effects
    * com.google.android.maps (maps.jar)
    API for Google Maps
    Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in

    Tag/ABIs : default/armeabi-v7a

    id: 6 or "Google Inc.:Google APIs (x86 System Image):19"
    Name: Google APIs (x86 System Image)
    Type: Add-On
    Vendor: Google Inc.
    Revision: 17
    Description: Android x86 + Google APIs
    Based on Android 4.4.2 (API level 19)
    Libraries:
    * com.android.future.usb.accessory (usb.jar)
    API for USB Accessories
    * com.google.android.media.effects (effects.jar)
    Collection of video effects
    * com.google.android.maps (maps.jar)
    API for Google Maps
    Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in

    Tag/ABIs : default/x86

    id: 7 or "Google Inc.:Google APIs:23"
    Name: Google APIs
    Type: Add-On
    Vendor: Google Inc.
    Revision: 1
    Description: Android + Google APIs
    Based on Android 6.0 (API level 23)
    Libraries:
    * com.android.future.usb.accessory (usb.jar)
    API for USB Accessories
    * com.google.android.media.effects (effects.jar)
    Collection of video effects
    * com.google.android.maps (maps.jar)
    API for Google Maps
    Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in, AndroidWearRound, AndroidWearRound360x360, AndroidWearRound400x400, AndroidWearRound480x480, AndroidWearRoundChin320x290, AndroidWearRoundChin360x325, AndroidWearRoundChin360x330, AndroidWearSquare, AndroidWearSquare320x320
    Tag/ABIs : google_apis/armeabi-v7a, google_apis/x86, google_apis/x86_64

    Directories found in C:\Program Files (x86)\Android\android-sdk\build-tools are 19.1.0, 21.1.2, 22.0.1
    Versions found in C:\Program Files (x86)\Android\android-sdk\build-tools are 19.1.0, 21.1.2, 22.0.1
    Selected targetSdk is: 23
    Directories found in C:\Program Files (x86)\Android\android-sdk\extras\android\m2repository\com\android\support\appcompat-v7 are 18.0.0, 19.0.0, 19.0.1, 19.1.0, 20.0.0, 21.0.0, 21.0.2, 21.0.3, 22.0.0, 22.1.0, 22.1.1, 22.2.0, 22.2.1, 23.0.0, 23.0.1, 23.1.0, 23.1.1, maven-metadata.xml, maven-metadata.xml.md5, maven-metadata.xml.sha1
    Versions found in C:\Program Files (x86)\Android\android-sdk\extras\android\m2repository\com\android\support\appcompat-v7 are 18.0.0, 19.0.0, 19.0.1, 19.1.0, 20.0.0, 21.0.0, 21.0.2, 21.0.3, 22.0.0, 22.1.0, 22.1.1, 22.2.0, 22.2.1, 23.0.0, 23.0.1, 23.1.0, 23.1.1
    Selected AppCompat version is: 23.1.1
    spawn: C:\WINDOWS\system32\cmd.exe "/s" "/c" "c:\Avastec Projects\raise-app\platforms\android\gradlew" "buildapk" "-PcompileSdk=android-23" "-PtargetSdk=22" "-PbuildToolsVersion=22.0.1" "-PsupportVersion=23.1.1"
    Analytics statuses:
    { TrackFeatureUsage: 1, TrackExceptions: 0 }
    Trying to track feature 'Non-interactive' with value 'help'.
    List of registered commands: /?, autocomplete, autocomplete|disable, autocomplete|enable, autocomplete|status, build, build|android, build|ios, create, debug, debug|android, debug|ios, deploy, dev-post-install, dev-preuninstall, dev-test, dev-test|android, dev-test|ios, device, device|android, device|get-file, device|ios, device|list-applications, device|list-files, device|log, device|put-file, device|run, device|stop, device|uninstall, doctor, emulate, emulate|android, emulate|ios, error-reporting, help, init, install, library, library|add, livesync, platform, platform|add, platform|remove, platform|update, plugin, plugin|add, plugin|remove, prepare, run, run|android, run|ios, test, test|android, test|init, test|ios, usage-reporting
    Reading help for command 'run|android'. FileName is 'run-android.md'.

    run android

    ┌────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
    │ Usage │ Synopsis │
    │ Run on all connected devices and running emulators │ $ tns run android [--key-store-path --key-store-password --key-store-alias --key-store-alias-password ] [--release] [--justlaunch] │
    │ Run on a selected connected device or running emulator │ $ tns run android --device [--key-store-path --key-store-password --key-store-alias --key-store-alias-password ] [--release] [--justlaunch] │
    │ Start an emulator and run the app inside it │ $ tns run android --emulator [] [--key-store-path --key-store-password --key-store-alias --key-store-alias-password ] [--release] [--justlaunch] │
    └────────────────────────────────────────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

    Runs your project on a connected Android device or in a native Android emulator, if configured. This is shorthand for prepare, build and deploy. While your app is running, prints the output from the application in the console.

    Options

    * --device - Specifies a connected device on which to run the app. 
    * --emulator - If set, runs the app in a native emulator for the target platform, if configured. When set, you can also set any other valid combination of emulator options as listed by $ tns help emulate android. 
    * --release - If set, produces a release build. Otherwise, produces a debug build. When set, you must also specify the --key-store-* options.
    * --key-store-path - Specifies the file path to the keystore file (P12) which you want to use to code sign your APK. You can use the --key-store-* options along with --release to produce a signed release build. You need to specify all --key-store-* options.
    * --key-store-password - Provides the password for the keystore file specified with --key-store-path. You can use the --key-store-* options along with --release to produce a signed release build. You need to specify all --key-store-* options.
    * --key-store-alias - Provides the alias for the keystore file specified with --key-store-path. You can use the --key-store-* options along with --release to produce a signed release build. You need to specify all --key-store-* options.
    * --key-store-alias-password - Provides the password for the alias specified with --key-store-alias-password. You can use the --key-store-* options along with --release to produce a signed release build. You need to specify all --key-store-* options.
    * --justlaunch - If set, does not print the application output in the console. 
    

    Attributes

    * <Device ID> is the index or name of the target device as listed by $ tns device android
    * <Emulator Options> is any valid combination of options as listed by $ tns help emulate android
    
  3. teobugslayer commented on Dec 8, 2015

    @teobugslayer

    @Plamen5kov for opinion

  4. Plamen5kov commented on Dec 9, 2015

    @Plamen5kov
    Contributor

    hi,
    i tested it on windows and i got:

    D:\work\nativescript-cli\scratch\with space\app>tns --version
    1.5.1
    
    D:\work\nativescript-cli\scratch\with space\app>tns run android
    The ANDROID_HOME environment variable is not set or it points to a non-existent directory. You will not be able to perform any bui
    ld-related operations for Android.
    
    D:\work\nativescript-cli\scratch\with space\app>adp
    
    D:\work\nativescript-cli\scratch\with space\app>tns run android
    Copying template files...
    Project successfully created.
    Project successfully prepared
    'D:\work\nativescript-cli\scratch\with' is not recognized as an internal or external command,
    operable program or batch file.
    Command C:\WINDOWS\system32\cmd.exe failed with exit code 1
    

    it all points to it being a windows cmd problem:
    Command C:\WINDOWS\system32\cmd.exe failed with exit code 1

  5. teobugslayer commented on Dec 9, 2015

    @teobugslayer

    @stevetayloruk, I've reproduced the issue and working on a fix

  6. stevetayloruk commented on Dec 9, 2015

    @stevetayloruk
    Author

    thanks, let me know if I can help.

  7. teobugslayer commented on Dec 9, 2015

    @teobugslayer

    I've merged the fix. It should be included in the next version of NativeScript, which is scheduled for release next week.

  8. added this to the 1.5.1 milestone on Dec 9, 2015
  9. added
    ready for testTSC needs to test this and confirm against live production apps and automated test suites
    on Dec 10, 2015
  10. added and removed
    ready for testTSC needs to test this and confirm against live production apps and automated test suites
    on Dec 10, 2015
  11. lock commented on Aug 30, 2019

    @lock

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  12. locked and limited conversation to collaborators on Aug 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions