繁体   English   中英

Android应用程序构建由于firebase-storage:11.0.2依赖关系而失败

[英]Android App build fail because of firebase-storage:11.0.2 dependency

我正在尝试从我的Firebase存储中获取一些文件的url,为此,您必须添加依赖项:

    compile 'com.google.firebase:firebase-storage:11.0.2'

到应用程序级别gradle文件中的应用程序。 我这样做了,但是现在我收到了错误:

错误:任务':app:processDebugGoogleServices'的执行失败。>请通过更新google-services插件的版本来解决版本冲突(有关最新版本的信息, 访问https://bintray.com/android/android -tools / com.google.gms.google-services / )或将com.google.android.gms的版本更新为10.0.1。

我已经在线查看了问题,发现的唯一解决方案是我需要添加:

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

到我的应用程序级别gradle文件的底部,这已经有一段时间了。 我似乎无法弄清楚是什么原因导致此错误。

应用程序级别gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.3"
    defaultConfig {
        applicationId "com.lonelygamer.dmc"
        minSdkVersion 19
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

repositories {
    mavenCentral() // jcenter() works as well because it pulls from Maven Central
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.google.firebase:firebase-auth:10.0.1'
    compile 'com.google.firebase:firebase-database:10.0.1'
    compile 'com.google.firebase:firebase-storage:11.0.2'
    compile 'com.github.bumptech.glide:glide:4.0.0-RC1'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0-RC1'
    testCompile 'junit:junit:4.12'
}

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

所有Firebase和Google Play服务依赖项的版本必须相同。 还建议您使用最新版本的支持库:25.4.0。

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:25.4.0' // RECOMMENDED CHANGE
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.google.firebase:firebase-auth:11.0.2' // CHANGED
    compile 'com.google.firebase:firebase-database:11.0.2' // CHANGED
    compile 'com.google.firebase:firebase-storage:11.0.2'
    compile 'com.github.bumptech.glide:glide:4.0.0-RC1'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0-RC1'
    testCompile 'junit:junit:4.12'
}

更新您的SDK,然后在以下位置使用新的API和Google服务更新构建gradle文件:...然后同步gradle

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM