[Bug]: `cap run` fails with renamed outputs
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- android, typescript
調査の方向性
android/app/build.gradle と npx cap run android によって呼び出される Android の実行パスから始め、CLI が android/app/build/outputs/apk/debug 内の APK をどのように選択するかを調べます。そのロジックを output-metadata.json およびリンクされた再現環境内の名前変更された APK と比較し、cap run が app-debug.apk を前提とせずに生成された出力をデプロイすることを確認します。
索引モデルが issue の本文から書いたものです。
説明
Capacitor Version
Latest Dependencies:
@capacitor/cli: 7.4.0
@capacitor/core: 7.4.0
@capacitor/android: 7.4.0
@capacitor/ios: 7.4.0
Installed Dependencies:
@capacitor/ios: not installed
@capacitor/cli: 7.2.0
@capacitor/android: 7.2.0
@capacitor/core: 7.2.0
[success] Android looking great! 👌
Other API Details
`npm --version` output: 10.9.2
`node --version` output: v22.14.0
Platforms Affected
- iOS
- Android
- Web
Current Behavior
In preparation for publishing an app to F-Droid, I've configured my gradle build to use a more descriptive output name, so the APK includes the version. To do this, I've added the following line to ~\android\app\build.gradle:
android {
defaultConfig {
...
archivesBaseName = "$applicationId-v$versionCode"
...
This means that the output APK is now named io.ionic.starter-1-debug.apk (for example), rather than app-debug.apk.
However, when I try to run the app via npx cap run android, it now fails with the error:
× Deploying app-debug.apk to 28231FDH200GGJ - failed!
[error] Selected hardware device 28231FDH200GGJ
Error: ENOENT: no such file or directory, open 'C:\Dvt\myApp\android\app\build\outputs\apk\debug\app-debug.apk'
Expected Behavior
I would expect the CLI to determine the name of the APK built and use that, rather than expecting it to be app-debug.apk.
Project Reproduction
https://github.com/davidgeary/hardcoded-apk
Additional Information
A similar error about the CLI hardcoding the APK name was reported (and fixed) in #4740, but this was in regard to the configuration of flavours resulting in different APK names being generated and as such, the fix was very specific to the use of flavours.
But since the APK name can also be changed via the archivesBaseName setting and other ways, a more generic fix is required. For example, @dragermrb's suggestion of parsing ~\android\app\build\outputs\apk\debug\output-metadata.json appears to be a much more robust way of identifying the output from the build and would work regardless of the way the output filename was set.
- 主要言語
- TypeScript
- スター
- 17.1k
- フォーク
- 1.3k
- 平均マージ
- 1日 22時間
- マージ済み PR(30日)
- 26
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ionic-team/capacitor のほかの issue
-
triage
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
ionic-team/capacitor#8759 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: Plugin call after navigation can be answered before reply proxy is updated対応中かも @MateStrysewske が 71 日前に担当しました。 オープンtriage
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
ionic-team/capacitor#8616 ·
メンテナーはふだん 1 日以内に返信
-
help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
ionic-team/capacitor#8574 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
SystemBars: safe area CSS injection throws "Cannot read properties of null" on startup (Android 16)対応中かも @kttalley が 62 日前に担当しました。 オープンtriage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
ionic-team/capacitor#8530 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
fix(android): remove unchecked Java compilation warnings対応中かも @Ajamuar が 15 日前に担当しました。 オープンtriage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
ionic-team/capacitor#8529 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
ionic-team/capacitor の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
prio:low scope:world
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
OliverRomhagen/vrigstad-joyride#849 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
genfeedai/genfeed.ai#11916 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
erkamyaman/rust-anything#1153 ·
メンテナーはふだん 1 日以内に返信
-
The Phase 5 report says 0.3.0 waits for the live check対応中かも @fzn0x が今日担当しました。 オープンdocumentation
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信