NativeScript / NativeScript/nativescript-cli

Error for invalid min runtime version in a plugin is misleading

Ouverte
#3,987 0 commentaires 1 réaction 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

to-be-checked
Langage dominant
JavaScript
Étoiles
1.1k
Forks
204
Merge moyen
1 j 9 h
PR mergées (30 j)
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.

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Reproduisez l’échec en suivant les étapes indiquées, en commençant par les valeurs de version dans src/package.json et le workflow pack.sh, puis exécutez tns run android depuis demo-angular. Suivez l’endroit où la CLI traite la version minimale du runtime du plugin avant le début du build. Le travail est terminé lorsque des valeurs non valides telles que "next" produisent directement une erreur de validation qui répertorie les formats pris en charge et arrête le build.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
javascript
Domaine
cli, mobile-dev
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
38/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.