3

更新(2019 年 11 月 7 日)

我已经尝试了以下命令,它按预期工作假设flavor=Stagingbuild= ReleaseBuild_Variant= StagingRelease。并基于Flutter入口点文件(--target)=lib/main_stg.dart

./gradlew appDistributionUploadStagingRelease --project-prop target=lib/main_stg.dart

appDistributionUploadStagingRelease即使assembleStagingRelease未在命令中添加,似乎也需要重新构建 apk。

问题

我有一个项目,其中包含以下风格和目标

Flavors
- Dev
- Staging
- Production

Targets (<project_root/lib>)
- main_dev.dart (development)
- main_stg.dart (staging)
- main.dart     (production)

我一直在使用这个命令 flutter build --release --target staging --t lib/main_stg.dart来构建 Staging。

但是,当使用 执行 FirebaseAppDistribution 时./gradlew appDistributionStagingRelease,上传的 APK 会忽略lib/main_stg.dart并使用lib/main.dart.

进一步检查日志表明它没有重建

> Task :app:appDistributionUploadStagingRelease
Found APK at <project_root>/build/app/outputs/apk/staging/release/app-staging-release.apk.
Uploading APK to Firebase App Distribution...
Getting appId from output of google services plugin
This APK has not been uploaded before.
Uploading the APK.
Uploaded APK successfully 202
No release notes passed in. Skipping this step.
Added testers/groups successfully 200
App Distribution upload finished successfully!

有没有Flutter开发人员遇到类似的问题?请指导我。

谢谢你

4

0 回答 0