为什么要连接到Firebase,从Android Studio中为我的应用程序提供一个问题 [英] Why is connecting to Firebase giving my application an issue from Android Studio
本文介绍了为什么要连接到Firebase,从Android Studio中为我的应用程序提供一个问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
依赖关系{
编译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:24.2.1'
compile'com.android.support:design:24.2。 1'
compile'com.android.support:support-v4:24.2.1'
compile'com.google.android.gms:play-services:7.5.0'
compile' com.google.firebase:firebase-core:9.8.0'
testCompile'junit:junit:4.12'
}
apply plugin:'com.google .gms.google-services'
build.grade(Project):
buildscript {
repositories {
jcenter()
}
依赖关系{
classpath'com .android.tools.build:gradle:2.2.0'
classpath'com.google.gms:google-services:3.0.0'
//注意:不要在这里放置应用程序依赖关系;他们属于
//在个人模块build.gradle文件
}
}
Google服务和Google存储库都是根据SDK进行更新的。
我收到以下错误:
错误:(42,1)评估项目:app时发生问题。
>无法应用插件[id'com.google.gms.google-services']
>版本:7.5.0低于google-services插件所需的最低版本(9.0.0)。
我试图从我的应用程序连接到Firebase,并且有 文件夹中的文件应用程序如何解决问题来连接到Firebase。 更改 google
解决方案
$ b $ $
b $ b 至
编译'com.google.android.gms:play-services:9.8.0'
结论:
依赖项{
编译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:24.2.1'
compile'com.android .support:design:24.2.1'
compile'com.android.support:support-v4:24.2.1'
compile'com.google.android.gms:play-services:9.8.0 '
compile'com.google.firebase:firebase-core:9.8.0'
testCompile'junit:junit:4.12'
}
build.gradle (app):
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:24.2.1'
compile 'com.android.support:design:24.2.1'
compile 'com.android.support:support-v4:24.2.1'
compile 'com.google.android.gms:play-services:7.5.0'
compile 'com.google.firebase:firebase-core:9.8.0'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
build.grade (Project):
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'
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
}
}
Google services and Google repositories are all up to date as per the SDK.
I am getting the following error:
Error:(42, 1) A problem occurred evaluating project ':app'.
> Failed to apply plugin [id 'com.google.gms.google-services']
> Version: 7.5.0 is lower than the minimum version (9.0.0) required for google-services plugin.
I am trying to connect to Firebase from my app and I have the google-services.json
file inside the app
folder.
How can I resolve the issue to connect to Firebase.
解决方案 change
compile 'com.google.android.gms:play-services:7.5.0'
to
compile 'com.google.android.gms:play-services:9.8.0'
In conclusion:
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:24.2.1'
compile 'com.android.support:design:24.2.1'
compile 'com.android.support:support-v4:24.2.1'
compile 'com.google.android.gms:play-services:9.8.0'
compile 'com.google.firebase:firebase-core:9.8.0'
testCompile 'junit:junit:4.12'
}
这篇关于为什么要连接到Firebase,从Android Studio中为我的应用程序提供一个问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文