【发布时间】:2019-06-06 09:09:15
【问题描述】:
在我的项目中包含 Firebase 核心依赖项后
implementation 'com.google.firebase:firebase-core:15.0.2'
我收到此错误。
程序类型已存在: android.support.v4.app.INotificationSideChannel Message{kind=ERROR, text=程序类型已经存在: android.support.v4.app.INotificationSideChannel,来源=[未知 源文件],工具名=Optional.of(D8)}
我遇到了一些类似的问题,但似乎都没有解决我的错误。
这是我的应用级别build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion "28.0.2"
defaultConfig {
applicationId "com.example.chandranichatterjee.appname"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.0-alpha1'
//implementation 'com.google.firebase:firebase-core:11.2.0'
implementation 'com.google.firebase:firebase-core:15.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0-alpha3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha3'
}
apply plugin: 'com.google.gms.google-services'
下面是我的项目级别build.gradle:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
classpath 'com.google.gms:google-services:4.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
我还在gradle.properties 中添加了以下行:
android.useAndroidX=true
android.enableJetifier=true
感谢任何帮助。谢谢!
【问题讨论】:
-
尝试使用最新的
implementation 'com.google.firebase:firebase-core:16.0.6'firebase.google.com/support/release-notes/android -
尝试用
api替换implementation -
@NileshRathod 仍然遇到同样的错误
-
@ChandraniChatterjee 检查此stackoverflow.com/questions/50289355/…
-
@NileshRathod 已经检查了那个问题,但这没有帮助。
标签: android firebase build.gradle