为Flutter应用生成SHA-1 [英] Generate SHA-1 for Flutter app
问题描述
我正在尝试为Flutter应用生成SHA-1,以便Android Studio支持Google登录,但是我不知道该怎么做,我看到了一些指示要运行命令的帖子,但是
有人可以帮我吗?
如何获取Release和Debug密钥:另一种最简单的方法(2019年5月)。所有操作都在Android Studio内部。
- 选择android / app / build.gradle文件,然后在右上角单击打开以进行编辑Android Studio
< ol start = 2>
请参见< a href = https://stackoverflow.com/questions/52253196/android-studio-gradle-tab/62337288#62337288> Android studio Gradle Tab
- 就是这样!如果您使用Firebase,请在此处添加这两个键。您应该同时添加两个密钥,否则,如果没有释放密钥,则Google登录将无法在设备上运行。
终端的另一种用法。如果找不到打开以供编辑..链接。
转到终端中的项目文件夹。
Mac
keytool -list -v -keystore〜/ .android / debug.keystore -alias androiddebugkey -storepass android -keypass android
Windows
keytool -list -v -keystore \.android\debug.keystore -alias androiddebugkey -storepass android -keypass android
I'm trying to generate a SHA-1 for a Flutter app, for Android studio to support Google Sign in, but I don't know how to do that, I saw some posts that indicate to run a command, but there I need a jks file I guess, and flutter doesn't create that.
Could someone help me?
How to get Release and Debug keys: one more the easiest way (May 2019). All actions are inside Android Studio.
- Select android/app/build.gradle file and on the right top corner click "Open for Editing in Android Studio"
- Open Gradle panel and double click on "SigninReport",
- That's it! If you use Firebase - add these 2 keys there. You should add both keys, otherwise, without the release key, Google login will not work on the devices.
Another way with the terminal. In case you can't find the "Open for editing .." link.
Go to the project folder in the terminal.
Mac
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
Windows
keytool -list -v -keystore "\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
这篇关于为Flutter应用生成SHA-1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!