NativeScript / NativeScript/nativescript-cli

Error for invalid min runtime version in a plugin is misleading

オープン
#3,987 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

to-be-checked
主要言語
JavaScript
スター
1.1k
フォーク
204
平均マージ
1日 9時間
マージ済み PR(30日)
8

説明

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.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

記載された手順に従って失敗を再現します。まず src/package.json のバージョン値と pack.sh workflow から始め、次に demo-angular から tns run android を実行します。ビルドが始まる前に、CLI がプラグインの最小ランタイムバージョンを処理する箇所を追跡します。"next" のような無効な値が、サポートされている形式を列挙した直接的な検証エラーを出力し、ビルドを停止すれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript
領域
cli, mobile-dev
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
38/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。