NativeScript / NativeScript/nativescript-cli
Error for invalid min runtime version in a plugin is misleading
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- JavaScript
- Star
- 1.1k
- Fork
- 204
- Merge trung bình
- 1 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 8
Mô tả
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
- Clone the nativescript-ui-listview plugin repo
- Change the nativescript-android and ios versions in src/package.json file to next
- Pack the plugin with
sh pack.sh - Add the plugin to one of the demos (e.g. cd demo-angular && tns plugin add ../publish/package/*.tgz)
- 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.
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Tái hiện lỗi bằng cách thực hiện các bước được liệt kê, bắt đầu với các giá trị phiên bản trong src/package.json và workflow pack.sh, sau đó chạy tns run android từ demo-angular. Theo dõi nơi CLI xử lý phiên bản runtime tối thiểu của plugin trước khi quá trình build bắt đầu. Hoàn thành khi các giá trị không hợp lệ như "next" tạo ra lỗi xác thực trực tiếp, liệt kê các định dạng được hỗ trợ và dừng quá trình build.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- javascript
- Lĩnh vực
- cli, mobile-dev
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 38/100