导入Firebase_Messaging会使构建失败

时间:2019-07-19 03:16:06

标签: firebase flutter dart firebase-cloud-messaging

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

我尝试更新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

1 个答案:

答案 0 :(得分:0)

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