【问题标题】:Importing Firebase_Messaging makes build fail导入 Firebase_Messaging 会导致构建失败
【发布时间】:2019-07-19 03:16:06
【问题描述】:

当我将 firebase_messaging 导入我的应用程序时(在 pubspec.yaml 和 import 语句中)。我的应用程序无法构建。在尝试导入 firebase_messaging 之前它运行良好。我检查了颤振目录以确保它是正确的版本和一切。我有点不知所措。

我尝试更新android,并且颤抖。

Pubspec.yaml

     dependencies:
  firebase_core: ^0.4.0+6
  firebase_analytics: ^3.0.2
  cloud_firestore: ^0.12.5+1

  firebase_auth: ^0.11.1+6
  google_sign_in: ^4.0.2
  rxdart: ^0.22.0
  css_colors: ^1.0.2
  flutter_auth_buttons: ^0.5.0
  firebase_messaging: ^5.1.2

这是错误信息

     Could not determine the dependencies of task 
':app:compileDebugJavaWithJavac'.
> 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 19.0.0.

 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 onto com.google.firebase:firebase- messaging@18.0.0
 -- Project 'app' depends on project 'firebase_messaging' which depends onto 
com.google.firebase:firebase-messaging@18.0.
  0
  -- Project 'app' depends onto com.google.firebase:firebase-core@17.0.0
  -- Project 'app' depends on project 'firebase_core' which depends onto 
com.google.firebase:firebase-core@16.0.9
     -- Project 'app' depends onto com.google.firebase:firebase- 
   analytics@17.0.0
      -- Project 'app' depends on project 'firebase_analytics' which depends 
    onto com.google.firebase:firebase-analytics@16.5.
  0
      -- Project 'app' depends onto com.google.android.gms:play-services- 
   measurement-api@17.0.0
  -- Project 'app' depends onto com.google.firebase:firebase-iid@19.0.0

  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


 BUILD FAILED in 5s

【问题讨论】:

    标签: firebase flutter dart firebase-cloud-messaging


    【解决方案1】:

    好吧,在做了更多研究之后,我找到了答案。 我添加了 实施 'com.google.firebase:firebase-messaging:19.0.1' 到我的应用级 gradle 文件,我收到一些警告,但应用程序本身会构建并运行。

    【讨论】:

    • 谢谢!这让我发疯了。怎么没有更多的人遇到这个问题?我完全按照文档进行了操作,这绝对不在其中。如果有人知道我很想知道,我仍然对这些东西一无所知。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-09-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-09-05
    • 1970-01-01
    相关资源
    最近更新 更多