Skip to content

WearOSアプリのversionCodeが本体アプリを下回る逆転を解消しrelease署名を本体アプリのアップロード鍵に統一 - #6613

Merged
TinyKitten merged 2 commits into
devfrom
fix/wear-os-version-code
Aug 9, 2026
Merged

TinyKitten merged 2 commits into
devfrom
fix/wear-os-version-code

Conversation

@TinyKitten

@TinyKitten TinyKitten commented Aug 8, 2026 •

Copy link
Copy Markdown
Member

概要

Google Play で Wear OS バンドルを含むリリースが「このリリースは公開できません。既存のユーザーに対し、新たに追加された App Bundle へのアップグレードを許可していないためです。」と拒否される問題を修正します。

あわせて、:wearable の release ビルドが debug 鍵で署名されていて Play にアップロードできない状態だったため、:app と同じアップロード鍵に統一します。

変更の種類

  • バグ修正
  • 新機能
  • リファクタリング
  • ドキュメント
  • CI/CD
  • その他

変更内容

  • :wearable の versionCode を 100000000 → 100000580(:app の 100000579 + 1)に修正し、wearable = app + 1 の採番規約を復元
  • :wearable の versionName を 10.0.0 → 10.12.0 に更新し :app と揃える
  • :wearable の release 署名を signingConfigs.debug から、:app と同じ TRAINLCD_UPLOAD_* プロパティを参照する release config に変更

公開が拒否された原因

:app と :wearable は applicationId が同一(me.tinykitten.trainlcd)のマルチバンドル配信です。この構成では Play は minSdk が高い側(:wearable = 34 > :app = 24)の versionCode が高いことを要求します。この大小関係が逆転していたため、新規追加した Wear バンドルが常に :app に順位負けしてどの端末にも配信されず、公開がブロックされていました。

時期 :app :wearable 関係
9.0.1(Play の現行 Wear バンドル) 90001010 90001011 app + 1 ✅
10.0.0 100000000 100000001 app + 1 ✅
EASにお引越し (#4539) 100000079 100000000 逆転 ❌
修正前 HEAD (10.12.0) 100000579 100000000 逆転 ❌
本 PR 100000579 100000580 app + 1 ✅

#4539 で :app だけが 100000079 に進み、:wearable は 100000000 に固定されたまま :app のみインクリメントされ続けたことが原因です。

release 署名について

:wearable の release ビルドタイプが signingConfigs.getByName("debug") を参照していたため、生成される AAB が debug 鍵(CN=Android Debug)で署名され、Play のアップロード鍵と一致しない状態でした。:app と同じ TRAINLCD_UPLOAD_* プロパティ方式に統一しています。

TRAINLCD_UPLOAD_STORE_FILE は :app モジュール起点の相対パス(release.jks)として運用されているため、:wearable からは app/ を基準に解決しています。また storeFile が空の signingConfig を割り当てると signProdReleaseBundle が NPE で落ちるため、プロパティが揃っている場合のみ signingConfig を生成し、未設定時は :app と同様に未署名となるようにしています。

回帰リスクと対策

  • debug 署名への影響なし: signingReport で prodDebug が引き続き android/app/debug.keystore を参照することを確認済み(WearOSアプリのdebug署名を本体アプリと同じ鍵に統一 #6610 の Data Layer 疎通設定は不変)。
  • minSdk / targetSdk は不変: 34 / 35 のまま。現行の Play 公開バンドル(9.0.1)も minSdk 34 のため、既存ユーザーの切り捨ては発生しません。
  • 採番規約の脆弱性は未解消: wearable = app + 1 は手動での lockstep bump が前提のため、:app を bump する際は本ファイルも必ず同時に bump する必要があります。この制約はコード内コメントに明記しました。versionCode の一元管理と CI への Wear ビルド追加は本 PR のスコープ外です。
  • 実鍵での署名検証は未実施: 検証用 keystore を生成できなかったため、signingReport による解決先の一致確認までにとどまります。下記コマンドで実鍵での確認が可能です。
cd android && ./gradlew :wearable:bundleProdRelease \
  -PTRAINLCD_UPLOAD_STORE_FILE=release.jks \
  -PTRAINLCD_UPLOAD_STORE_PASSWORD=... \
  -PTRAINLCD_UPLOAD_KEY_ALIAS=... \
  -PTRAINLCD_UPLOAD_KEY_PASSWORD=...
keytool -printcert -jarfile wearable/build/outputs/bundle/prodRelease/wearable-prod-release.aab

テスト

npm run lint / npm test / npm run typecheck に加え、Gradle 側で以下を確認しました。

確認項目 結果
./gradlew :wearable:bundleProdRelease BUILD SUCCESSFUL
生成 AAB のマニフェスト versionCode=100000580 / versionName=10.12.0 / minSdk=34 / targetSdk=35
:wearable:signingReport prodRelease android/app/release.jks
:app:signingReport prodRelease android/app/release.jks(一致)
:wearable:signingReport prodDebug android/app/debug.keystore(変更なし)
  • npm run lint が通ること
  • npm test が通ること
  • npm run typecheck が通ること

関連Issue

スクリーンショット(任意)

Summary by CodeRabbit

  • 改善
    • リリースビルドで、設定された署名情報を自動的に適用できるようになりました。
    • 署名情報が未設定の場合は、署名なしでビルドされます。
    • 絶対パスまたはアプリ基準の相対パスでキーストアを指定できます。
    • 開発版および製品版のバージョン番号を更新しました。

@TinyKitten TinyKitten self-assigned this Aug 8, 2026
@coderabbitai

coderabbitai Bot commented Aug 8, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 65873177-8e93-4903-9c06-efec96bfccd7

📥 Commits

Reviewing files that changed from the base of the PR and between 7ede94f and 6baf9b6.

📒 Files selected for processing (1)
  • android/wearable/build.gradle.kts

📝 Walkthrough

Walkthrough

Wearableのreleaseビルドに条件付きの署名設定を追加しました。キーストアは絶対パスまたはapp/基準の相対パスで指定できます。未設定時は署名なしです。dev/prodフレーバーのバージョン情報も更新しました。

Changes

Wearableリリース構成

Layer / File(s) Summary
リリース署名設定
android/wearable/build.gradle.kts
TRAINLCD_UPLOAD_*の4プロパティがすべて有効な場合に、release署名設定を生成します。キーストアは絶対パスまたはapp/基準の相対パスで解決します。releaseビルドは存在するrelease署名設定を使用します。
Wearableバージョン更新
android/wearable/build.gradle.kts
dev/prodフレーバーをversionCode = 100000580、versionName = "10.12.0"に更新します。Wear側のversionCode要件に関するコメントを追加します。

Estimated code review effort: 3 (Moderate) | ~20 minutes

Poem

うさぎが鍵をそっと持ち
releaseへ署名を届けます
未設定なら静かに待ち
Wearableの番号も跳ね上がる
月の夜にビルドは進む

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed タイトルはWear OSのversionCode逆転解消とrelease署名統一という主要変更を明確に示しています。
Description check ✅ Passed 概要、変更内容、テスト結果、変更区分を具体的に記載し、テンプレートの必須項目を十分に満たしています。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/wear-os-version-code

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@android/wearable/build.gradle.kts`:
- Around line 33-40: Update the release signing configuration around
create("release") so it is created only when all four TRAINLCD_UPLOAD_*
properties—store file, store password, key alias, and key password—are
non-empty; otherwise skip creating the release SigningConfig.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c06aa98f-bcb8-45cc-83f5-f27faae4eead

📥 Commits

Reviewing files that changed from the base of the PR and between 0ec4ddd and 7ede94f.

📒 Files selected for processing (1)
  • android/wearable/build.gradle.kts

Comment thread android/wearable/build.gradle.kts Resolved
@TinyKitten
TinyKitten merged commit 10c0b18 into dev Aug 9, 2026
3 checks passed
@TinyKitten
TinyKitten deleted the fix/wear-os-version-code branch August 9, 2026 00:00
This was referenced Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant