Skip to content

Android build fails when path to app has space and plugin should be build #3560

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rosen-vladimirov opened this issue May 3, 2018 · 4 comments
Assignees
Labels
Milestone

Comments

@rosen-vladimirov
Copy link
Contributor

Did you verify this is a real problem by searching the NativeScript Forum and the other open issues in this repo?

Yes

Tell us about the problem

Android build fails in case the path to project has space and the project has a plugin that should be build. For example, in case you have nativescript-mapbox as a dependency and you place your project in a directory which has space in its name, the build/run commands will fail as CLI is unable to build the plugin.

Which platform(s) does your issue occur on?

Android

Please provide the following version numbers that your issue occurs with:

  • CLI: 4.0.0
  • Cross-platform modules: Not applicable
  • Runtime(s): Not applicable
  • Plugin(s):
"dependencies": {
        "nativescript-mapbox": "^3.3.0",
        "nativescript-theme-core": "~1.0.4",
        "tns-core-modules": "~4.0.0"
}

Please tell us how to recreate the issue in as much detail as possible.

  1. Create application with space in the name: $ tns create "my app"
  2. Navigate to the app: $ cd my\ app
  3. Add nativescript-mapbox plugin: $ npm i --save nativescript-mapbox
  4. Try building the application for android: $ tns build android

The build will fail with error:

Failed to build plugin nativescript-mapbox :
Error: Command failed: gradlew.bat -p D:\Work\nativescript-cli\scratch\my app\platforms\tempPlugin\nativescript_mapbox assembleRelease -PcompileSdk=android-27 -PbuildToolsVersion=27.0.3 -PsupportVersion=26.0.0-alpha1

FAILURE: Build failed with an exception.

* What went wrong:
The specified project directory 'D:\Work\nativescript-cli\scratch\my' does not exist.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 9s

Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.

No

@msamprz
Copy link

msamprz commented May 9, 2018

Thanks for the fix. Any work around for the time being until it's published? I have a deadline close I need to finish up.

@rosen-vladimirov
Copy link
Contributor Author

Hey @msamprz ,
You can install the rc version of CLI, which has the fix. Just execute npm install -g nativescript@rc.

@msamprz
Copy link

msamprz commented May 9, 2018

@rosen-vladimirov Thanks a lot for that, and the quick response.

@xeroxstar
Copy link

xeroxstar commented May 18, 2018

I had this problem today from nowhere, but with vue-cli-template.

Unable to apply changes on device Error is: Command gradlew.bat failed with exit code 1.

The problem in mapbox but removing the mapbox only from package.json didnt help me in this case, i had to reinstall the vue-cli-template. If you have the same problem and you are using vue-cli-template, just reinstall your project and it should work.

vue init nativescript-vue/vue-cli-template <project-name>
https://github.com/nativescript-vue/vue-cli-template

I hope it will help someone 🥇

Before you reinstall the template, make sure your main.js file is backed up otherwise it overwrites your main.js file and you will be mad as I was 👎 👎 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants