【问题标题】:Error when added firebase packages in Flutter project在 Flutter 项目中添加 firebase 包时出错
【发布时间】:2020-07-26 11:34:49
【问题描述】:

在我在 pubspec.yaml 文件中添加 'firebase_auth: ^0.15.5+3' 之前,我的 Flutter 应用程序运行良好。我对这个错误感到震惊:

Launching lib\main.dart on BLN L22 in debug mode...
[!] Your app isn't using AndroidX.
    To avoid potential build failures, you can quickly migrate your app by following the steps on (some google link here).
Running Gradle task 'assembleDebug'...
C:\Users\soham\AndroidStudioProjects\flutter_app\android\app\src\debug\AndroidManifest.xml:22:18-91 Error:
    Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
    is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
    Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:8:5-29:19 to override.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
    is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
    Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:8:5-29:19 to override.

* 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.


BUILD FAILED in 2m 36s
AndroidX incompatibilities may have caused this build to fail. Please migrate your app to AndroidX. See (some google link here)
Finished with error: Gradle task assembleDebug failed with exit code 1

我也尝试将 minSdkVersion 从 16 更改为 21,但没有成功。

(我是 Flutter 和 android 开发的新手)

【问题讨论】:

  • 扑医生给你什么?

标签: android firebase android-studio flutter flutter-dependencies


【解决方案1】:

转到 -> C:\Users\soham\AndroidStudioProjects\flutter_app\android\app\src\main\AndroidManifest.xml

application标签内添加tools:replace="android:appComponentFactory"

【讨论】:

    猜你喜欢
    • 2020-05-16
    • 1970-01-01
    • 2019-10-25
    • 2019-10-11
    • 2019-03-06
    • 2018-03-22
    • 2019-10-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多