【发布时间】:2018-09-26 15:39:37
【问题描述】:
我使用了google_sign_in 3.0.5 包并按照文档中给出的说明使用了完全相同的代码。
谁能告诉我在按照说明操作时我可能遗漏了什么,以及我必须做些什么才能让它发挥作用。
【问题讨论】:
-
发布你的踪迹。
-
我很想知道这个问题的解决方法,它对我也不起作用
标签: dart flutter google-oauth
我使用了google_sign_in 3.0.5 包并按照文档中给出的说明使用了完全相同的代码。
谁能告诉我在按照说明操作时我可能遗漏了什么,以及我必须做些什么才能让它发挥作用。
【问题讨论】:
标签: dart flutter google-oauth
您需要使用 SHA-1 对您的客户端进行身份验证。在终端中执行此操作以生成 SHA-1
keytool -exportcert -list -v \ -alias androiddebugkey -keystore %USERPROFILE%.android\debug.keystore
或按照说明here
然后,当您需要将 SHA-1 复制到 Firebase 上的项目设置中时
【讨论】:
classpath 'com.google.gms:google-services:4.0.1 -> 使用classpath 'com.google.gms:google-services:3.2.1' firebase.google.com/docs/flutter/setup
statusCode="Canceled" 的原因是因为我没有更新我的“android/app/build.gradle”文件以使其指向我的密钥库/密钥
android {
compileSdkVersion 27
lintOptions {
disable 'InvalidPackage'
}
signingConfigs {
release {
storeFile file("path to key/ key") # .keystore or .jsk file extensions
storePassword 'password'
keyAlias 'alias'
keyPassword 'password'
}
debug {
storeFile file("path to key/ key") # .keystore or .jsk file extensions
storePassword 'password'
keyAlias 'alias'
keyPassword 'password'
}
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.applicationName"
minSdkVersion 16
targetSdkVersion 27
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.release
}
debug {
signingConfig signingConfigs.debug
}
}
}
【讨论】: