Android应用程序构建失败,因为firebase存储:11.0.2依赖关系
我正在尝试从firebase存储中获取一些文件url,为此,您必须添加依赖项:Android应用程序构建失败,因为firebase存储:11.0.2依赖关系,android,firebase,firebase-realtime-database,dependencies,firebase-storage,Android,Firebase,Firebase Realtime Database,Dependencies,Firebase Storage,我正在尝试从firebase存储中获取一些文件url,为此,您必须添加依赖项: compile 'com.google.firebase:firebase-storage:11.0.2' 应用程序级别的渐变文件中的应用程序。我这样做了,但现在我收到了错误: 错误:任务“:app:ProcessDebuggGoogleServices”的执行失败。“>请通过更新google services插件的版本(有关最新版本的信息,请访问)或将com.google.android.gms的版本更新
compile 'com.google.firebase:firebase-storage:11.0.2'
应用程序级别的渐变文件中的应用程序。我这样做了,但现在我收到了错误:
错误:任务“:app:ProcessDebuggGoogleServices”的执行失败。“>请通过更新google services插件的版本(有关最新版本的信息,请访问)或将com.google.android.gms的版本更新为10.0.1来修复版本冲突
我在网上查找了这个问题,找到的唯一解决方案是我需要添加:
apply plugin: 'com.google.gms.google-services'
到我的应用程序级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'
更新SDK,然后使用新的API和google服务更新build gradle文件,网址为。。。。然后同步gradle所有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'
}
发布你的应用程序模块build.gradle。所有Firebase和Google Play服务依赖项的版本都必须相同。@BobSnyder:好了