問題描述
Flutter + FlutterFire 版本根據遷移指南使用 firebase_messaging 解決失敗的 firebase_remote_config (Flutter + FlutterFire version solving failed firebase_remote_config with firebase_messaging as per migration guide)
我檢查了很多類似的問題,但沒有正確的答案,所以再次發布。
我想同時使用 firebase_messaging 和 firebase_remote_config。但它與 firebase_core
Working Perfect When:
firebase_core: ^0.5.0+1
firebase_messaging: ^7.0.3
當我添加 firebase_remote_config
時出現問題strong>:firebase_remote_config: ^0.6.0
出現錯誤:
因為 firebase_remote_config >=0.6.0 取決於 firebase_core ^0.7.0 而 flutter_app 取決於firebase_core ^0.5.0+1, firebase_remote_config >=0.6.0 被禁止。所以,因為 flutter_app 依賴於 firebase_remote_config ^0.6.0,
參考解法
方法 1:
It's basically a problem with
firebase_messaging
. It should depend on the newestcore
package, but it does not (for some mysterious reason). To get the newest info on this, follow https://github.com/FirebaseExtended/flutterfire/issues/4650 cause the situation may develop dynamically, but as of 5.02.2021, working solution is to upgradefirebase_messaging
to^8.0.0‑dev.14
version. It's not stable, so we shouldn't be really happy with that, but we have no other option right now.(by Pratik Butani、Szymon Kowaliński)
參考文件