はじめに
Firebase App Distribution の appDistributionUpload
の Gradle task を実行した際に
== BUILD FAILED ==
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:appDistributionUploadXxxYyy'.
> App Distribution found more than 1 output file for this variant. Please contact firebase-support@google.com for help using APK splits with App Distribution.
が表示された場合の解決方法です。
(APK splits を行っている Android project で再現します。)
原因
ビルドを行うと複数の apk ファイルが生成され、どの apk ファイルがアップロード対象かどうかが特定できないためです。
対応
build.gradle
の distribution properties に apkPath
を指定する。
例)
buildTypes {
release {
...
firebaseAppDistribution {
apkPath = "app/build/outputs/apk/xxxYyy/debug/xxx.apk"
}
}
}
productFlavors を設定している場合は、もう少し工夫が必要そう。。。
※仕様に明記されていないので、サポートされなくなる可能性もあります。
【追記:2020/05/11】
英語のドキュメントには apkPath
が記載されていました。
https://firebase.google.com/docs/app-distribution/android/distribute-gradle?hl=en#step_3_configure_your_distribution_properties
(日本語はまだでした…)
※Gradle Plugin 1.2.0 で動作確認済み