Flutter Firebase(firebase_core)无法在Android上构建

时间:2019-04-07 11:04:31

标签: firebase flutter

在使用Firebase插件并启动Android构建时,出现以下错误:

ERROR: Failed to resolve: com.google.firebase:firebase-core:
Affected Modules: app, firebase_core.

在iOS上运行正常。

FAILURE: Build failed with an exception.
* 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 com.google.firebase:firebase-core:.
     Required by:
         project :app
         project :app > project :firebase_core

2 个答案:

答案 0 :(得分:0)

发生此问题是因为FlutterFire正在迁移到BoM。
要暂时解决此问题,您应该只使用Select A,C,D from my table;

ideal solution将在您的firebase_core: 0.3.1+1模块的 settings.gradle 中添加以下内容:

android

但是,这可能不起作用。在这种情况下,您暂时应该恢复为enableFeaturePreview('IMPROVED_POM_SUPPORT')

您可以找到有关here的更多信息。

答案 1 :(得分:0)

firebase_core的0.3.4更新修复了此问题,该更新是Flutter Firebase其他插件的依赖项。您应该能够通过“ flutter软件包升级”获得修复。

https://github.com/flutter/plugins/pull/1464/files