本文介绍了Android上的firebase设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
限时删除!!
我无法在android studio上设置更新的firebase版本。
我已经在站点firebase上创建了项目的json文件,并将其复制到项目中,然后在gradle中进行处理:
buildscript {
// ...
依赖关系{
// ...
classpath'com.google.gms:google-services:3.0.0'
apply plugin:'com.android.application'
android {
// ...
}
dependencies {
编译'com.google.firebase:firebase-core:9.0.1'
}
//在底部添加
apply plugin:'com.google.gms。 google-services'
我得到以下错误:
未能解决:compile'com.google.firebase:firebase-core:9.0.0'
我该如何解决这个问题?解决方案
我有同样的问题。如果您使用的是Android Studio,那么您应该在SDK Manager中更新 google repository
。
$ b 以下是我的 build.grade(app)
apply plugin:'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion23.0.3
useLibrary'org .apache.http.legacy'
defaultConfig {
applicationId包名称
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName1.0
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules .pro'
}
$ b依赖关系{
编译'com.google.firebase:firebase-core:9.0.0'
}
apply plugin:'com.google.gms.google-services'
这是我的 build.grade(project)
buildscript {
repositories {
jcenter()
}
依赖项{
classpath'com.android.tools.build:gradle:2.1.0'
classpath'com.google.gms:google-services:3.0.0 '
//注意:不要在这里放置您的应用程序依赖关系;它们属于单个模块build.gradle文件中的
//
}
}
allprojects {
repositories {
jcenter()
}
}
I can't setup the updated version of firebase on android studio.I've created json file of the project on the site firebase and copied it into the project and after coping lines in gradle:
buildscript {
// ...
dependencies {
// ...
classpath 'com.google.gms:google-services:3.0.0'
}
}
apply plugin: 'com.android.application'
android {
// ...
}
dependencies {
compile 'com.google.firebase:firebase-core:9.0.1'
}
// ADD THIS AT THE BOTTOM
apply plugin: 'com.google.gms.google-services'
I get the following error:
failed to resolve: compile 'com.google.firebase:firebase-core:9.0.0'
How can I fix it?
解决方案
I had the same problem. If you are using Android studio, you should then update google repository
in SDK Manager.
Following is my build.grade(app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "package name"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile 'com.google.firebase:firebase-core:9.0.0'
}
apply plugin: 'com.google.gms.google-services'
And this is my build.grade(project)
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.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
}
}
allprojects {
repositories {
jcenter()
}
}
这篇关于Android上的firebase设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
1403页,肝出来的..