NativeScript / NativeScript/nativescript-cli

Error for invalid min runtime version in a plugin is misleading

Open
#3,987 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

to-be-checked
Dominant language
JavaScript
Stars
1.1k
Forks
204
Avg merge
1d 9h
Merged PRs (30d)
8

Description

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 5.0.0-2018-10-08-12406

Describe the bug
When installing a plugin with wrong min runtime version (e.g. "next") the error that is thrown while building the app is misleading.

To Reproduce

  1. Clone the nativescript-ui-listview plugin repo
  2. Change the nativescript-android and ios versions in src/package.json file to next
  3. Pack the plugin with sh pack.sh
  4. Add the plugin to one of the demos (e.g. cd demo-angular && tns plugin add ../publish/package/*.tgz)
  5. Execute tns run android
Preparing project...
Executing before-prepareJSApp hook from /Users/dtodorov/SSD/nativescript-ui-listview/demo-angular/hooks/before-prepareJSApp/nativescript-dev-webpack.js
Successfully prepared plugin nativescript-angular for android.
Successfully prepared plugin nativescript-fresco for android.
Successfully prepared plugin nativescript-theme-core for android.
Unable to apply changes on device: emulator-5554. Error is: Processing node_modules failed. TypeError: Invalid Version: next.
Building project...
Gradle build...
Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/dtodorov/SSD/nativescript-ui-listview/demo-angular/platforms/android/app/build.gradle' line: 65

* What went wrong:
A problem occurred evaluating project ':app'.
>
  'dependencies.json' file not found. Check whether the NativeScript CLI has prepared the project beforehand,
  and that your NativeScript version is 3.3, or a more recent one. To build an android project with the current
  version of the {N} CLI install a previous version of the runtime package - 'tns platform add android@3.2'.


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

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

BUILD FAILED in 0s
Unable to apply changes on device: 01a5bd7074a39516. Error is: Command ./gradlew failed with exit code 1.

Expected behavior
The error should point what exactly is the issue, which are supported formats and shouldn't proceed with build.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure using the listed steps, starting with the version values in src/package.json and the pack.sh workflow, then run tns run android from demo-angular. Trace where the CLI processes the plugin's minimum runtime version before the build begins. Done means invalid values such as "next" produce a direct validation error that lists supported formats and stops the build.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cli, mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.