找不到与com.google.firebase:firebase-core:18.0。+匹配的任何版本。

时间:2019-07-11 16:38:35

标签: firebase cordova ionic4

当我尝试使用Cordova构建APK时,我正在研究Ionic Project (ionic cordova build android)尽管几天前它仍然运行正常,但我仍然遇到此错误。我在网上尝试了所有建议的解决方案。 任何帮助都会很好

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
   > Could not find any version that matches com.google.firebase:firebase-core:18.0.+.
     Versions that do not match:
       - 11.0.4
       - 11.0.2
       - 11.0.1
       - 11.0.0
       - 10.2.6
       - + 35 more
     Required by:
         project :app

* 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

1 个答案:

答案 0 :(得分:0)

这是一个常见问题。我通常会看到人们对Google服务有疑问。

我不知道确切的正确术语,但是不同的软件包依赖于不同的版本,并且不兼容。

有一些插件可以在Google Services发生时自动修复此问题,但我不确定这个问题。

您可以通过调整Gradle文件来手动覆盖它。

通过确保将所有与Firebase相关的软件包更新为package.json中的最新版本,您也许可以解决此问题。

如果这不起作用,将是一个更复杂的过程,需要在gradle文件中查找所有不正确的引用,并将它们更新为针对单个通用版本。

更新

我刚刚注意到你这样说:

  

尽管几天前它仍然运行良好,但我仍然遇到此错误

如果是这种情况,那么最近几天您将哪个插件添加到了项目中。可能是过时的,也是造成问题的原因。