将Firebase添加到我的依赖项“程序已存在”后出现错误

时间:2019-02-13 18:04:57

标签: java android firebase

最近在将Firebase添加到我的代码中后,显示“程序类型已存在” 全栈: 错误:程序类型已经存在:com.firebase.client.android.AndroidCredentialStore

build.gradle应用程序:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.example.user.candleclub"
        minSdkVersion 23
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support:cardview-v7:26.1.0'
    implementation 'com.android.support:design:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.google.firebase:firebase-database:16.0.6'
    implementation 'com.google.firebase:firebase-storage:16.0.5'
    implementation 'com.google.firebase:firebase-auth:16.1.0'
    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.github.yukuku:ambilwarna:2.0.1'
    implementation 'com.android.support:support-annotations:28.0.0'
    // implementation 'com.github.kencheung4:android-StickerView:1.0.0'
    implementation 'com.github.hotchemi:permissionsdispatcher:3.1.0'
    annotationProcessor 'com.github.hotchemi:permissionsdispatcher-processor:3.1.0'
    implementation project(':android-StickerView')
    implementation 'com.vanniktech:emoji:0.5.1'
    implementation 'com.vanniktech:emoji-ios:0.5.1'
    implementation 'com.vanniktech:emoji-one:0.5.1'
    implementation 'com.vanniktech:emoji-google:0.5.1'
    implementation 'com.vanniktech:emoji-twitter:0.5.1'
    implementation 'com.firebase:firebase-client-android:2.5.2'
    implementation 'com.google.firebase:firebase-measurement-connector-impl:17.0.5'
    implementation "android.arch.core:runtime:1.1.1"
    implementation "android.arch.core:common:1.1.1"
    implementation 'com.google.android.gms:play-services-location:16.0.0'
    implementation 'com.google.android.gms:play-services-places:16.0.0'
    implementation 'com.google.firebase:firebase-messaging:17.3.4'
    implementation 'com.google.android.gms:play-services-maps:16.1.0'

    implementation 'com.google.firebase:firebase-core:16.0.7'
}
apply plugin: 'com.google.gms.google-services'

项目gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.1'
        classpath 'com.google.gms:google-services:4.1.0'


        // 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
}

manifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.example.user.candleclub">

    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.INTERNET" />

    <meta-data
        tools:replace="android:value"
        android:name="android.support.VERSION"
        android:value="26.1.0" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".ChooseFrame" />
        <activity android:name=".PrintActivity" />
        <activity android:name=".MainMenu">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".MainActivity" />
    </application>

</manifest>

试图添加各种依赖关系,但并没有解决。有人有主意吗?

编辑:注释掉所有Firebase依赖项后,没有错误。有人知道为什么吗?有没有办法使用Firebase的存储而不会出现错误?

0 个答案:

没有答案