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

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
android, javascript
領域
cli, mobile

調査の方向性

lib/services/platform-service.ts の、リンクされている APK 選択ロジックの周辺から始め、tns run android が app.gradle の flavor から生成された複数の APK をどのように扱うかを確認します。CLI オプションと、flavor または APK の選択に関して期待される動作を定義し、そのうえで tns run android がビルド順に依存せず、要求された APK を一貫して起動することを検証します。

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

説明

feature os: android run
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
主要言語
JavaScript
スター
1.1k
フォーク
204
平均マージ
1日 9時間
マージ済み PR(30日)
8

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

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

はじめの一歩

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

NativeScript/nativescript-cli のほかの issue

NativeScript/nativescript-cli の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

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

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