2

I'm trying to generate a valid keystore for my application with the signature algorithm: SH1withRSA.

I have generated an API key with SHA1 from the keystore that was generated previously and set tiapp.xml to use Google maps v2:

<manifest android:versionCode="10" android:versionName="1.0">
        <uses-permission android:name="android.permission.INTERNET"/>
        <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
        <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
        <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
        <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
        <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
        <uses-permission android:name="android.permission.CALL_PHONE" />
        <uses-permission android:name="com.vivelabbogota.idutest.permission.MAPS_RECEIVE"/>
        <uses-feature android:glEsVersion="0x00020000" android:required="true"/>
        <permission
            android:name="com.vivelabbogota.idutest.permission.MAPS_RECEIVE" android:protectionLevel="signature"/>
        <application android:debuggable="false">                
            <meta-data
                android:name="com.google.android.geo.API_KEY" android:value="AIzaSyBtJKvPPfpbioLqKVz213JOYDxOpoHCriE"/>
            <uses-library android:required="true"  android:name="com.google.android.maps"/>
        </application>
        <application android:theme="@style/Theme.NoActionBar"/>
        <!-- Need to specify at least API level 11 for Titanium SDK 3.2.x and prior -->
        <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="16"/>
    </manifest>

Later, I built a signed apk with the keystore, but when I install this apk the map does't load (only shows a grid). In the other hand if I sign the apk with default Titanium keystore, which is signed with MD5withRSA, the map loads.

Can you help me with this?

Harshad Pansuriya
  • 20,189
  • 8
  • 67
  • 95

2 Answers2

0

Your problem i think is that you use the same api key for two different type of service , your map loads on debug but not on release ! you have to know that you have to generate another SHA1 with your keystore not debug.keystore , and then generate a new api key in google console with your keystore SHA1 .
hope it can help

0

In Google Developers you added SHA1 for developer key only. That's why it stopped working when you signed it with distribution key. Just add SHA1 for distribution key for API key you generated (yes, you can add multiple SHA1 for same API key). This way you won't have to change anything in app and it will allow you to switch between developer/distribution version with maps working any time you want.

kreatywny
  • 214
  • 2
  • 13