Eclipse“自定义调试密钥库"的等价物是什么?在安卓工作室? [英] What is the equivalent of Eclipse "Custom debug Keystore" in Android studio?

查看:27
本文介绍了Eclipse“自定义调试密钥库"的等价物是什么?在安卓工作室?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用 Google Maps API 时,我已经习惯于在 Eclipse 中使用自定义调试键(这实际上是我的生产键)

As I am working with Google Maps API, I have been used to work with a custom debug key in Eclipse (that is in fact my production key)

这种操作允许我在调试和发布版本中对地图和大多数 Google Play 服务(在应用计费中)使用相同的 API 密钥.

This manipulation allowed me to use the same API key for Maps and most of Google Play Services (in app billing) in my debug and release build.

这真的很方便,因为不需要更改清单中的键.

This was really convenient because there was no need to change the key in the manifest.

不幸的是,随着迁移到 Android Studio,我缺少此功能.

Unfortunately, with the migration to Android Studio, I am missing this feature.

知道在哪里可以找到这个选项吗?

Any idea where I can find this option back?

非常感谢.

推荐答案

您在 build.gradle 文件中定义了一个密钥库.请参阅此处的签名配置部分:https://developer.android.com/studio/build/index.html

You define a keystore in your build.gradle file. See the Signing Configurations section here: https://developer.android.com/studio/build/index.html

在您的情况下,您想为调试变体重新定义密钥库:

In your case, you want to redefine the keystore for the debug variant:

android {
    signingConfigs {
        debug {
            storeFile file("your.keystore")
        }
    }
}

但是,您确实应该使用两个不同的密钥库进行调试和发布配置.

However, you should really be using two different keystores for debug and release configurations.

这篇关于Eclipse“自定义调试密钥库"的等价物是什么?在安卓工作室?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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