【发布时间】:2019-12-12 16:22:51
【问题描述】:
我有一个正在运行的 Android 项目,我正在尝试添加 Firebase 分析。一旦我将 implementation 'com.google.firebase:firebase-analytics:17.2.1' 添加到我的 graddle 中,它就会在帖子末尾给我错误。我尝试了我在其他帖子中找到的几个建议,例如在 appcompat 行的末尾添加“-alpha1”,但这是一个漏洞。我也做了错误提示的事情,但另一个兔子洞也是如此。
有人有其他建议吗?
应用插件:'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.track.live"
minSdkVersion 17
targetSdkVersion 28
versionCode 1
versionName "1.0"
vectorDrawables.useSupportLibrary = true
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.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.intuit.sdp:sdp-android:1.0.4'
implementation 'com.intuit.ssp:ssp-android:1.0.4'
implementation 'io.realm:realm-android:0.82.1'
implementation 'me.jahirfiquitiva:FABsMenu:1.1.4'
implementation 'com.google.maps.android:android-maps-utils:0.5'
implementation 'com.google.android.gms:play-services-maps:16.1.0'
testImplementation 'junit:junit:4.12'
annotationProcessor 'io.realm:realm-android:0.82.1'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.volley:volley:1.1.0'
implementation 'com.google.firebase:firebase-analytics:17.2.1'
}
apply plugin: 'com.google.gms.google-services'
错误:清单合并失败:属性 应用程序@appComponentFactory 值=(android.support.v4.app.CoreComponentFactory)来自 [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 也出现在 [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 值=(androidx.core.app.CoreComponentFactory)。建议:加 'tools:replace="android:appComponentFactory"' 到元素 在 AndroidManifest.xml:14:5-52:19 处覆盖。
【问题讨论】:
-
你添加了 firebase-core 库吗?
-
不确定,我做了 Firebase 页面所说的一切。只是这最后一步给我带来了问题。
-
也许您只是按照分析库的步骤进行操作,但在此之前您应该检查此firebase.google.com/docs/android/setup 并建议使用 androidX 而不是 com.android.support。谷歌它
标签: android firebase firebase-analytics