Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
153 views
in Technique[技术] by (71.8m points)

What is the equivalent of Eclipse "Custom debug Keystore" in Android studio?

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)

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.

enter image description here

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

Any idea where I can find this option back?

Thank a lot.

question from:https://stackoverflow.com/questions/17189076/what-is-the-equivalent-of-eclipse-custom-debug-keystore-in-android-studio

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...