Storing Secret Keys
googleMapApiKey="AIzaSyBDjzqiK5_DVoZ-6nCSZNFwEYM9dr1q7MI"
fabricApiKey="50d77fbd594f6229f8bb9a3669ce18dce7dac38e"def keyFile = file('../keys.properties')
def keyProperties = new Properties()
keyProperties.load(new FileInputStream(keyFile))
android {
...
defaultConfig {
...
resValue 'string', "googleMapKey", keyProperties["googleMapApiKey"]
resValue 'string', "fabricKey", keyProperties['fabricApiKey']
}<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/googleMapKey" />
<meta-data
android:name="io.fabric.ApiKey"
android:value="@string/fabricKey" />Last updated