NativeScript / NativeScript/nativescript-cli

Multiple flavors in Android project: no way to specify which APK to run after build

Đang mở
#3,538 3 bình luận 3 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

feature os: android run
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ả

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

When specifying multiple flavors in the app.gradle and thus more than one APK gets generated during build, the CLI prints a warning More than one .apk found in ... directory. Using the last one produced from build.

So depending on Gradle's internal workings when doing a tns run android the APK that was built first is picked. Which may not be the right one in this case.

https://github.com/NativeScript/nativescript-cli/blob/8cd21b8f437eb37c14d0bd1df9babce7f53d7ee9/lib/services/platform-service.ts#L800

Would be great if the CLI would have an option to specify which flavor (or APK) to be used on tns run

Which platform(s) does your issue occur on?

macOS, Android build

Please provide the following version numbers that your issue occurs with:
  • CLI: 4.0.0
  • Cross-platform modules: tns-core-modules 4.0.1
  • Runtime(s): tns-androd 4.0.1

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu trong lib/services/platform-service.ts, tại phần logic lựa chọn APK được liên kết, và xem xét cách tns run android xử lý nhiều APK được tạo từ các flavor của app.gradle. Xác định tùy chọn CLI và hành vi dự kiến khi lựa chọn flavor hoặc APK, sau đó xác minh rằng tns run android luôn khởi chạy APK được yêu cầu thay vì dựa vào thứ tự 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ệ
android, javascript
Lĩnh vực
cli, mobile
Loại issue
Tính năng
Độ khó
4/5
Thời gian dự kiến
3-5 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
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.