简体   繁体   English

Android 添加 Firebase 分析时构建失败

[英]Android fail to build when add Firebase Analytics

I'm trying to add firebase-analytics:17.4.4 to my project with this build.gradle :我正在尝试使用此build.gradle将 firebase firebase-analytics:17.4.4添加到我的项目中:

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
    compileSdkVersion 28
    buildToolsVersion "28.0.3"
    defaultConfig {
        applicationId "*************"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.+'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.android.support:design:28.+'
    implementation 'com.android.support:support-v4:28.+'
    implementation 'com.google.code.gson:gson:2.8.6'
    implementation("com.squareup.okhttp3:okhttp:4.7.2")
    implementation 'com.android.support:recyclerview-v7:28.0.0'
    implementation 'com.github.javadev:underscore:1.55'

    implementation 'com.google.firebase:firebase-analytics:17.4.4'

    implementation 'com.github.bumptech.glide:glide:4.9.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
}

The problem that when i try to build the project i get this error:当我尝试构建项目时出现此错误的问题:

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:9:5-26:19 to override.

Firebase Analytics 17.0.0+ uses AndroidX. Firebase Analytics 17.0.0+ 使用 AndroidX。 So you'll have to migrate your app to AndroidX to use it.因此,您必须将您的应用程序迁移到 AndroidX才能使用它。

Reference: https://firebase.google.com/support/release-notes/android#2019-06-17参考: https://firebase.google.com/support/release-notes/android#2019-06-17

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 Android Studio 4.1 中使用 Tensorflow lite 元数据时构建失败 - Build fail when using Tensorflow lite metadata in Android Studio 4.1 经过身份验证的Android无法添加Firebase - Can't add in Firebase when authentified Android 当 testng 测试失败时 mvn build 失败 - mvn build fail when testng test fail 在 ADD_TO_CART 中将项目 arraylist 设置为 firebase 分析事件不起作用(Android) - Set Item arraylist to firebase analytics event in ADD_TO_CART not working (Android) 包含Firebase和GMS服务时,Android Gradle构建失败,发生异常 - Android gradle build failed with an exception when include firebase and gms service Android - Google Analytics管理器,包含Google Analytics和Firebase Analytics - Android - Google tag Manager with Google Analytics and Firebase Analytics Android build.gradle失败Android工作室 - Android build.gradle fail Android studio 在 firebase 上注册失败 java android studio - Registration on firebase fail java android studio Firebase Analytics(Android):在Logcat日志中看到的事件,但在Firebase控制台中却没有 - Firebase Analytics (Android): events seen in Logcat log but not in Firebase console Kotlin kapt和android架构组件构建失败 - Kotlin kapt and android architecture components build fail
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM