Firebase核心库集成
Firebase平台适用于创建对应谷歌项目,并集成谷歌特殊功能的平台。
项目创建
企业微信截图_15792428439272.png
企业微信截图_15792430348471.png
添加应用
企业微信截图_20200117143944.png
获取应用的SHA-1值:
企业微信截图_20200117144743.png
企业微信截图_20200117144926.png
企业微信截图_20200117145338.png
企业微信截图_20200117145451.png
SDK集成
Project/build gradle配置:
buildscript {
repositories {
jcenter()
//需配置
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
//需配置
classpath 'com.google.gms:google-services:4.2.0'
}
}
allprojects {
repositories {
maven { url "https://maven.google.com"}
maven { url 'https://jitpack.io' }
mavenCentral()
jcenter()
//需配置
google()
}
}
-
app/build gradle配置:
apply plugin: 'com.android.application'
android {
// ...
}
dependencies {
// 核心库的集成
implementation 'com.google.firebase:firebase-core:17.0.0'
}
// Add the following line to the bottom of the file:
apply plugin: 'com.google.gms.google-services' // Google Play services Gradle plugin