我试图在我的Android Studio项目中添加Firebase,但我无法摆脱一个错误:“找不到com.google.gsm:google-services:3.0.0;在以下位置搜索......“
我按照此处的说明进行操作:
https://firebase.google.com/docs/android/setup#available_libraries
我导入了我的google项目,为项目提供了名称和SHA-1密钥,下载了配置文件...然后我进入了Android Studio终端并输入以下命令:“move%google- services.json location%/ app“并修改gradle.build文件:
gradle.build(项目)文件:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0-alpha6'
classpath 'com.google.gsm: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()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
build.gradle(app)文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion '24.0.0'
defaultConfig {
applicationId "com.example.francydarkcool.maps"
minSdkVersion 16
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.google.android.gms:play-services:9.2.1'
compile 'com.google.android.gms:play-services-maps:9.2.1'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha4'
testCompile 'junit:junit:4.12'
compile 'com.google.firebase:firebase-core:9.2.1'
compile 'com.android.support:support-v4:24.1.0'
// compile 'com.android.support:appcompat-v7:24.1.1'
}
apply plugin: 'com.google.gsm.google-services'
PS。 Google Play服务和Google Repository都已安装并且是最新的。
答案 0 :(得分:0)
您可以通过重命名如下所示的行来尝试此操作:
import pygal
wm = pygal.maps.world.World()
wm.force_uri_protocol = 'http'
wm.title = 'Countries I\'ve Been To'
wm.add('United States',{'us':2016})
wm.render_to_file('myplaces.svg')
正如上面的另一个答案所指出的,有一个错字。让我知道它是怎么回事?
祝你好运!答案 1 :(得分:0)
错字:
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0-alpha6'
classpath 'com.google.gsm:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
应该是" gms"而不是" gsm":
classpath 'com.google.gms:google-services:3.0.0'
和
apply plugin: 'com.google.gms.google-services'