为Flutter应用生成SHA-1 [英] Generate SHA-1 for Flutter app

查看:111
本文介绍了为Flutter应用生成SHA-1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为Flutter应用生成SHA-1,以便Android Studio支持Google登录,但是我不知道该怎么做,我看到了一些指示要运行命令的帖子,但是



有人可以帮我吗?

解决方案

如何获取Release和Debug密钥:另一种最简单的方法(2019年5月)。所有操作都在Android Studio内部。


  1. 选择android / app / build.gradle文件,然后在右上角单击打开以进行编辑Android Studio



< ol start = 2>
  • 打开Gradle面板并双击 SigninReport,

  • 请参见< a href = https://stackoverflow.com/questions/52253196/android-studio-gradle-tab/62337288#62337288> Android studio Gradle Tab




    1. 就是这样!如果您使用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.

    1. Select android/app/build.gradle file and on the right top corner click "Open for Editing in Android Studio"

    1. Open Gradle panel and double click on "SigninReport",

    see Android studio Gradle Tab

    1. 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屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆