gpt4 book ai didi

java - Firebase 依赖项导致 Gradle 构建错误 - 程序类型已存在

转载 作者:行者123 更新时间:2023-11-29 04:18:21 25 4
gpt4 key购买 nike

我最近更新了我的 Build.Gradle 文件,但我的项目没有成功构建。在研究了几个可能的问题之后,我遇到了 [this post][1],表明它可能与我的 Firebase 依赖项发生冲突。它也可能与 multidex 有关,但基于错误的模糊程度,我什至没有一个起点:

错误:

Program type already present: android.arch.core.util.Function   

构建. Gradle :

apply plugin: 'com.android.application'

android {
compileSdkVersion 27
buildToolsVersion '27.0.3'

defaultConfig {
vectorDrawables.useSupportLibrary = true
applicationId "xxxxxxxx"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
multiDexEnabled true

}

dexOptions {
javaMaxHeapSize "4g"

}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')

// Support library
implementation "com.android.support:design:27.1.1"
implementation "com.android.support:cardview-v7:27.1.1"
implementation "com.android.support:support-v4:27.1.1"
implementation "com.android.support:appcompat-v7:27.1.1"



// Firebase
implementation "com.google.firebase:firebase-storage:16.0.1"
implementation "com.google.firebase:firebase-core:16.0.0"
implementation "com.google.firebase:firebase-auth:16.0.1"
implementation "com.google.android.gms:play-services-auth:15.0.1"
// implementation "com.google.firebase:firebase-database:$playServicesVersion"
implementation "com.google.firebase:firebase-appindexing:15.0.1"
implementation "com.google.firebase:firebase-firestore:17.0.1"
implementation 'com.firebaseui:firebase-ui-firestore:4.0.0'
implementation 'com.firebaseui:firebase-ui-database:3.3.1'


// Third party
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.facebook.android:facebook-android-sdk:4.+'
implementation 'jp.wasabeef:recyclerview-animators:2.2.3'
implementation 'com.github.clans:fab:1.6.2'
implementation 'de.hdodenhof:circleimageview:2.0.0'
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.squareup.okhttp3:okhttp:3.1.2'
implementation 'com.github.PhilJay:MPAndroidChart:v2.2.2'
implementation 'com.google.code.gson:gson:2.6.2'
implementation 'com.squareup.retrofit2:retrofit:2.1.0'
implementation 'com.squareup.retrofit2:converter-gson:2.1.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
implementation 'com.android.support:multidex:1.0.3'
}

构建.Gradle

buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
google()
}

dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.google.gms:google-services:4.0.1'
}
}

allprojects {
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
maven { url 'https://jitpack.io' }
maven { url "https://maven.google.com" }

maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

ext {
supportLibVersion = "27.1.1"
playServicesVersion = "17.0.1"
}

最佳答案

添加这些依赖项:

implementation "android.arch.core:runtime:$version"
implementation "android.arch.core:common:$version"

您可以在此处找到更多信息:https://github.com/firebase/FirebaseUI-Android/issues/1357

关于java - Firebase 依赖项导致 Gradle 构建错误 - 程序类型已存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50900897/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com