Ошибка при добавлении пакетов Firebase в проект Flutter - PullRequest
0 голосов
/ 13 апреля 2020

Мое приложение флаттера работало совершенно нормально, пока я не добавил 'firebase_auth: ^ 0.15.5 + 3' - эта зависимость в моем файле pubspe c .yaml. Я поражен этой ошибкой:

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 на 21 с 16, но din не работал.

(Я новичок в флаттер и развитие android )

1 Ответ

0 голосов
/ 13 апреля 2020

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

внутри приложение тег add инструменты: заменить = "android: appComponentFactory"

...