修复 Play Store 构建包含 Wear OS 信号导致发布被拒

概述

Play Store 拒绝了 version code 4089568 的发布,要求 Wear OS 应用使用独立轨道。原因是 phone-playstore 构建中仍包含来自插件的 Wear OS 信号。

根因

通过 bundletool 解析原始 AAB (doudou-21.0.0-2026-07-15-playstore.aab) 发现以下 Wear OS 信号未被移除:

  • uses-feature: android.hardware.type.watch — 来自 wear_plus 插件
  • uses-library: com.google.android.wearable — 来自 play-services-wearable
  • queries: com.google.android.wearable.app — 来自 watch_connectivity 插件
  • DoudouWearableListenerService — 来自 phone manifest 合并

之前的 AndroidManifest-playstore.xml 只移除了 uses-feature,遗漏了其余信号。

修复

android/app/src/phone/AndroidManifest-playstore.xml 中添加 tools:node="remove" 显式移除所有 Wear OS 声明:

  • uses-feature: android.hardware.type.watch
  • uses-library: com.google.android.wearable
  • queries: com.google.android.wearable.app / com.samsung.android.app.watchmanager
  • service: DoudouWearableListenerService

同时在 CI 工作流中为 playstore 目标添加 AAB 构建(Play Store 要求 AAB 格式)。

验证

本地构建 AAB 后用 bundletool 提取 APK 验证,manifest 中所有 Wear OS 信号已完全移除。

GitHub Actions 全平台构建通过 (run 29390900055):

  • ✓ Build android-phone-playstore (含 AAB)
  • ✓ Build android-tv-playstore (含 AAB)
  • ✓ 全部 9 个目标通过

Summary by CodeRabbit

  • New Features
    • Added Android App Bundle (AAB) outputs for Play Store phone and TV builds.
    • Included AAB files in nightly and tagged release packages.
  • Bug Fixes
    • Improved Play Store phone manifest handling by removing extra Wear OS/Wear-related declarations and services.
  • Build & Release Improvements
    • Updated Play Store build detection to work with both Gradle properties and Dart build-time flags, ensuring the correct Play Store-specific resources are used.
Edited by ien free

Merge request reports

Loading