如何在 Android Studio 中获取 SHA-1 指纹证书以进行调试模式? [英] How to get the SHA-1 fingerprint certificate in Android Studio for debug mode?

查看:34
本文介绍了如何在 Android Studio 中获取 SHA-1 指纹证书以进行调试模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经从

2.使用 Google 地图活动:

  1. 打开 Android Studio
  2. 打开你的项目
  3. 点击文件菜单 -> 选择新建 -> 点击Google -> 选择Google Maps Activity
  4. 会出现一个对话框 -> 点击完成
  5. Android Studio 会使用 google_maps_api.xml
  6. 自动生成一个 XML 文件 named
  7. 您将在此处获得调试 SHA1 密钥(位于 XML 文件的第 10 行)

检查下面的屏幕截图:

Android Studio V 2.2 更新

执行存在问题.

解决方案:

  • 运行栏
  • 点击切换任务执行/文本模式

检查下面的屏幕截图:

完成.

I have shifted myself from Eclipse to Android Studio. Now I am trying to work on my Map app. So I need my SHA-1 fingerprint certificate number.

When I was using Eclipse it was right under Windows -> Preferences -> Android -> Build. But in Android Studio I couldn't find out any option like this so that I could find easily the fingerprint. I am using Windows. I have read from this link that:

Android Studio signs your app in debug mode automatically when you run or debug your project from the IDE.

So I tried to run this in command line after setting my Java bin path from this link and unfortunately couldn't find my fingerprint. It is saying that it is an illegal option.

keytool -list -v -keystore "%USERPROFILE%\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android

Is there a way to find the SHA-1 fingerprint from Android Studio like it was very easy in Eclipse? As I am newbie in Android Studio, what is the full process to find it?

Another thing I want to add is that I have my Eclipse generates the SHA-1 fingerprint and previously I have my app registered on that fingerprint in Google developer console, and I worked on that app in Eclipse by that API key. Is the same API key can be worked on this my project in Android Studio?

解决方案

Easiest ways ever:

Update added for Android Studio V 2.2 in last step

There are two ways to do this.

1. Faster way:

  1. Open Android Studio
  2. Open your Project
  3. Click on Gradle (From Right Side Panel, you will see Gradle Bar)
  4. Click on Refresh (Click on Refresh from Gradle Bar, you will see List Gradle scripts of your Project)
  5. Click on Your Project (Your Project Name form List (root))
  6. Click on Tasks
  7. Click on Android
  8. Double Click on signingReport (You will get SHA1 and MD5 in Run Bar(Sometimes it will be in Gradle Console))
  9. Select app module from module selection dropdown to run or debug your application

Check the screenshot below:

2. Work with Google Maps Activity:

  1. Open Android Studio
  2. Open Your Project
  3. Click on File menu -> Select New -> Click on Google -> Select Google Maps Activity
  4. A dialog would appear -> Click on Finish
  5. Android Studio would automatically generate an XML file named with google_maps_api.xml
  6. You would get debug SHA1 key here (at line number 10 of the XML file)

Check Screenshot below:

Android Studio V 2.2 Update

There is an issue with Execution.

Solution:

  • Click on Toggle tasks execution/text mode from Run bar

Check Screenshot below:

Done.

这篇关于如何在 Android Studio 中获取 SHA-1 指纹证书以进行调试模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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