Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
245 views
in Technique[技术] by (71.8m points)

android - Manifest merger failed after adding Firebase core version 17.0.0

I added firebase crashlytics dependencies to my project and after that the project does not build.

https://firebase.google.com/docs/crashlytics/get-started?authuser=0&platform=android#android

Could you please suggest on what I might be doing wrong.

Thanks R

Build fails on these lines

implementation "com.google.android.gms:play-services-base:17.0.0"
implementation 'com.google.firebase:firebase-core:17.0.0'

This is the error log

Task :app:processDebugManifest FAILED
C:Developmentxxxxxx-appandroidappsrcmainAndroidManifest.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:7:5-35:19 to override.

See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.


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:7:5-35: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.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
See https://docs.gradle.org/4.8/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 3s
72 actionable tasks: 70 executed, 2 up-to-date

Gradle dependencies :

dependencies {
    compile project(':react-native-vector-icons')
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:28.0.0"
    compile "com.android.support:support-media-compat:28.0.0"
    compile "com.android.support:support-v4:28.0.0"
    compile "com.facebook.react:react-native:+"  // From node_modules
    compile project(':react-native-localization')
    compile project(':realm')
    compile project(':react-native-keychain')
    compile project(':react-native-device-info')
    compile project(':react-native-sensitive-info')
    compile project(':react-native-fs')
    implementation project(':react-native-firebase')
    implementation "com.google.android.gms:play-services-base:17.0.0"
    implementation 'com.google.firebase:firebase-core:17.0.0'
    implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
    //compile project(':react-native-secure-key-store')
}

Gradle :

buildscript {
    repositories {
        google()
        jcenter()
        maven {
            url 'https://maven.fabric.io/public'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.3'
        //classpath 'com.google.gms:google-services:3.0.0'
        classpath 'com.google.gms:google-services:4.2.0'
        classpath 'io.fabric.tools:gradle:1.29.0'  // Crashlytics plugin
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

ext {
    compileSdkVersion = 28
    buildToolsVersion = "28.0.0"
    minSdkVersion = 23
    targetSdkVersion = 28    
}

allprojects {
    repositories {
        mavenLocal()
        google()
        jcenter()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
    }
}

Gradle properties :

android.useDeprecatedNdk=true
android.enableAapt2=false
android.useAndroidX=false
android.enableJetifier=false
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...