gpt4 book ai didi

firebase - 如何知道在 Flutter 应用程序中使用哪个版本的 Google Firebase 插件?

转载 作者:行者123 更新时间:2023-12-03 01:16:08 31 4
gpt4 key购买 nike

我一直被 Gradle 无法构建所困扰(在 iOS 上工作得很好)。我很挣扎,因为 Gradle 给出了一个通用错误,今天终于得到了这个:

FAILURE: Build failed with an exception.

* What went wrong: Failed to capture fingerprint of input files for task ':app:preDebugBuild' property 'compileManifests' during up-to-date check.
> In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[18.0. 0]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.

Dependency failing: com.google.firebase:firebase-messaging:18.0.0 -> com.google.firebase:firebase-iid@[18.0.0], but fire base-iid version was 17.1.2.

The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the art ifact with the issue. -- Project 'app' depends on project 'firebase_messaging' which depends onto com.google.firebase:firebase-messaging@18.0. 0
-- Project 'app' depends on project 'firebase_core' which depends onto com.google.firebase:firebase-core@16.0.9 -- Project 'app' depends on project 'firebase_analytics' which depends onto com.google.firebase:firebase-analytics@16.5. 0 -- Project 'app' depends on project 'firebase_remote_config' which depends onto com.google.firebase:firebase-config@16.4 .1 -- Project 'app' depends onto com.google.firebase:firebase-core@16.0.9

For extended debugging info execute Gradle from the command line with ./gradlew --info :app:assembleDebug to see the dep endency paths to the artifact. This error message came from the google-services Gradle plugin, report issues at https:// github.com/google/play-services-plugins and disable by adding "googleServices { disableVersionCheck = false }" to your b uild.gradle file.

* Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

这是在我从 pubspec 中取出版本号以查看是否有帮助之后。我不明白 Google 的版本编号,也不确定应该安装哪个版本的插件,因为它在过去曾引起过冲突:

dependencies:
flutter:
sdk: flutter
http:
cached_network_image:
flutter_cache_manager:
carousel_pro:
cloud_firestore:
firebase_core:
firebase_remote_config:
dynamic_theme:
flutter_signin_button:
shared_preferences:
share:
flutter_search_bar:
google_sign_in:
#flutter_facebook_login:
flutter_html:
requests:
webview_flutter:
flutter_webview_plugin:
firebase_analytics:
flutter_app_badger: #for launcher badge icon (notifications)
uuid:
font_awesome_flutter:
device_info:
carousel_slider:
flutter_spinkit:
flutter_typeahead:
firebase_messaging:
html_unescape:
flutter_masked_text:
configurable_expansion_tile:
stripe_payment:
square_in_app_payments:

Google 似乎没有保持一致的版本编号,通过删除版本号,我认为它至少会采用理论上应该可以工作的最新版本的插件。那么,我该如何解决这个问题呢?

最佳答案

您应该首先将版本号放回其中。

这是 firebase/play 服务版本不匹配的问题,因此您可以确定 pubspec.yaml 中的其他插件都正常。

失败的依赖是 firebase 消息传递。

它用很多话来告诉你

com.google.firebase:firebase-messaging:18.0.0 package depends on com.google.firebase:firebase-iid@[18.0.0]

但只找到 17.1.2。

你需要

com.google.firebase:firebase-core@16.0.9
com.google.firebase:firebase-analytics@16.5.0
com.google.firebase:firebase-config@16.4.1

将来,如果您遇到版本问题,请检查特定包的 GitHub 问题,看看您当前使用的版本是否有任何问题。这将为您节省大量时间。

我不建议从 pubsepc.yaml 中删除版本号,但如果您输入

firebase_messaging: any

它将为您提供兼容版本。

关于firebase - 如何知道在 Flutter 应用程序中使用哪个版本的 Google Firebase 插件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56418405/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com