【问题标题】:Firebase core dependency : Program type already present: android.support.v4.app.INotificationSideChannelFirebase 核心依赖项:程序类型已存在:android.support.v4.app.INotificationSideChannel
【发布时间】: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

感谢任何帮助。谢谢!

【问题讨论】:

标签: android firebase build.gradle


【解决方案1】:

1.

classpath 'com.android.tools.build:gradle:3.1.0'

==>

classpath 'com.android.tools.build:gradle:3.2.0'

https://developer.android.com/studio/releases/gradle-plugin

Plugin version, Required Gradle version
3.2.0 - 3.2.1 , 4.6+ 
3.3.0 - 3.3.2 , 4.10.1+
3.4.0+        , 5.1.1+
  1. 添加gradle.properties
android.useAndroidX=true
android.enableJetifier=true

【讨论】:

  • 我在使用最新的 firebase + admob 构建 cocos2d-x 项目时发现了这个解决方案。
猜你喜欢
  • 1970-01-01
  • 2019-01-25
  • 2020-03-24
  • 2018-11-29
  • 2019-09-07
  • 1970-01-01
  • 2018-09-25
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多