Release application Google Maps native android

0

I am compiling an app that uses google maps in android studio . Your debug works perfectly, but when compiling it does not load the map. I would like to know what mistake I may be having. In both files located in debug and release called google_maps_api where the key is defined I have it defined. Then I do not know what mistake I may be having;

<string name="google_maps_key" templateMergeStrategy="preserve" translatable="true">MICLAVE</string>

My manifest :

<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
 package="com.ponny.radiomobile" >

<!--
     The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
     Google Maps Android API v2, but you must specify either coarse or fine
     location permissions for the 'MyLocation' functionality. 
-->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

<supports-screens
    android:anyDensity="true"
    android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:xlargeScreens="true" />

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme" >

    <!--
         The API key for Google Maps-based APIs is defined as a string resource.
         (See the file "res/values/google_maps_api.xml").
         Note that the API key is linked to the encryption key used to sign the APK.
         You need a different API key for each encryption key, including the release key that is used to
         sign the APK for publishing.
         You can define the keys for the debug and release targets in src/debug/ and src/release/. 
    -->
    <meta-data
        android:name="com.google.android.geo.API_KEY"
        android:value="@string/google_maps_key" />

    <activity
        android:name="com.ponny.radiomobile.MapsActivity"
        android:label="@string/title_activity_maps"
        android:configChanges="keyboardHidden|orientation|screenSize">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />
</application>

    
asked by Daniel ORTIZ 26.07.2016 в 22:55
source

1 answer

1

Note that when you release the application or compile it in release mode you need another API key for the Google Maps API, since one will only work in developer or debug mode, when it is going to be released it is necessary to generate its API key to the release using the following commands.

keytool -list -keystore your_keystore_name

keytool -list -v -keystore your_keystore_name -alias your_alias_name

link

    
answered by 27.07.2016 / 15:28
source