在奇怪的配置中添加firebase auth break gradle

时间:2016-09-03 02:00:56

标签: android gradle firebase

我正在尝试在同一个项目中使用firebase消息传递,auth和数据库,但是当我尝试将auth依赖项添加到gradle时,作为firebase'开始使用#39;指导指示,我得到 2308 298错误都与构建依赖关系有关。 这是我的应用程序特定的build.gradle

申请插件:' com.android.application'

android {
    compileSdkVersion 24
    buildToolsVersion "24.0.1"

    defaultConfig {
        applicationId "com.name.withheld"
        minSdkVersion 15
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    dexOptions {
        maxProcessCount 4 // this is the default value
        javaMaxHeapSize "2g"
    }

    // Enabling multidex support.
    //multiDexEnabled true
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    wearApp project(':wear')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:24.1.1'
    //I originally had all the play services enabled but now as a comment suggested I mm trying split dependencies.
    //compile 'com.google.android.gms:play-services:9.4.0'
    compile 'com.android.support:design:24.1.1'

   compile 'com.google.android.gms:play-services-base:9.4.0'
    compile 'com.google.android.gms:play-services-auth:9.4.0'
    compile 'com.google.firebase:firebase-database:9.4.0'
    compile 'com.google.firebase:firebase-auth:9.4.0'
    compile 'com.google.android.gms:play-services-auth:9.4.0'
}
apply plugin: 'com.google.gms.google-services'

也可以加快建设的任何方式

编辑:

  

我仍然遇到错误,但这一次是关于随机的com.google.android.gms:我从未听说过的依赖

播放服务任务

播放服务地下室

LOCAL:internal_impl-24.1.1.jar

和我以前用过的那些

com.android.support:support-v4

com.android.support:recyclerview-v7

  

有什么东西让我搞砸了我的构建环境,我在Windows 8.1上使用android studio 2.1.2

2 个答案:

答案 0 :(得分:1)

compile 'com.google.firebase:firebase-auth:9.2.0'

将全部更改为9.2.0并检查一次

答案 1 :(得分:1)

尝试此配置:

build.graddle(项目)

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

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}

build.graddle(模块)

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        multiDexEnabled = true
        applicationId "com.xxxxxx.xxxxxx"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 24
        versionName "1.1"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
android {
    useLibrary 'org.apache.http.legacy'
}
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'

    compile 'com.android.support:appcompat-v7:23.0.1'
    compile 'com.android.support:design:23.0.1'
    compile 'com.android.support:support-v4:23.0.1'

    compile 'com.google.firebase:firebase-core:9.2.1'
    compile 'com.google.firebase:firebase-database:9.2.1'
    compile 'com.google.firebase:firebase-storage:9.2.1'
    compile 'com.google.android.gms:play-services-maps:9.2.1'
    compile 'com.android.support:multidex:1.0.0'
    compile 'org.apache.commons:commons-lang3:3.4'

}

apply plugin: 'com.google.gms.google-services'