Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Google Maps API key for Android apps in debug mode

I've set the Google Maps API keys for Android in my tiapp.xml file:


For the production key, I followed the process for certificate/fingerprint on Google's site and generated an API key that works when I install the app from an .apk file generated from the "Distribute" tab in Titanium Developer.

I took the development key from the Kitchen Sink example app. It works fine from the Android Emulator, but when I install on an Android device from the "Run on Device" tab, the key doesn't work. I just get gray tiles on the map.

I guess taking the development key from Kitchen Sink isn't the best approach! What must I do to get a working API key in development mode?


— asked July 24th 2010 by Ryan McKillen
  • android
  • maps

6 Answers

  • Accepted Answer

    Hi, you need your own key
    go to android website enroll your key and use this configuration in your xml.

    <guid>GENERATED FROM YOUR APP</guid>
    <property name="ti.android.google.map.api.key">THE KEY U ISSUED</property>

    good luck

    — answered July 24th 2010 by Andrea S
    • I'm using my own API key in production, but it's my understanding that the keystore used to sign the app in debug mode is different, therefore a different API key is needed.

      — commented July 26th 2010 by Ryan McKillen
    • Added a ti.android.google.map.api.key property with the same key as my existing ti.android.google.map.api.key.production and it works.

      — commented July 28th 2010 by Ryan McKillen
    • Also of note: Titanium chokes on whitespace in this entry (and probably other property entries as well.

      <property name="ti.android.google.map.api.key">

      Does NOT work!

      <property name="ti.android.google.map.api.key">THE_KEY_U_ISSUED</property>

      Does work

      — commented March 8th 2012 by Eric Rushing
  • Ahh… found the problem!! You need to have to have <code>

    <property name="ti.android.google.map.api.key.production">YOUR API KEY ISSUED HERE WITH NO SPACES</property>

    This worked for me. I hope this helps anyone else out there with the same problem :)

    — answered August 14th 2012 by Paulo Dichone
  • I am still having issue with this. After getting my api key from Google ( after going through the entire process )
    I am still getting a blank mapview with gray tiles on the map, but not the actual map. Anyone has any other suggestions, please?

    — answered August 14th 2012 by Paulo Dichone
    1 Comment
    • I also having this problem. I'm sure I did everything right, but still cant get the Maps to work. Did you get it to work?

      — commented December 20th 2012 by Paul Merks
  • Make sure you have the internet permission set in the manifest file

    <uses-permission android:name="android.permission.INTERNET"/>

    Try that and let us know.

    — answered December 20th 2012 by Paulo Dichone
  • I am having the same issue. At first the screen goes black and then the map area appears with the zoom and current location controls. No tiles no images.
    I use the following tiap.xml. Anyone that knows what am i doing wrong.

    <?xml version="1.0" encoding="UTF-8"?>
    <ti:app xmlns:ti="http://ti.appcelerator.org">
        <description>Anatolia Elementary School Communicator</description>
        <copyright>2013 by 3pi Information Systems</copyright>
        <analytics>false</analytics><!-- was true-->
        <property name="ti.ui.defaultunit" type="string">system</property>
        <property name="ti.android.bug2373.finishfalseroot" type="bool">true</property>
        <property name="ti.android.google.map.api.key">my production key here</property>
        <property name="ti.android.google.map.api.key.production">my production key here </property>
        <property name="ti.android.google.map.api.key.development">my debug key here</property>
            <orientations device="iphone">
            <orientations device="ipad">
        <property name="ti.android.fastdev" type="bool">false</property>
        <android xmlns:android="http://schemas.android.com/apk/res/android">
            <manifest android:versionCode="1000007" android:versionName="1.0.7">
                <uses-permission android:name="android.permission.INTERNET"/>
                <!-- Allows the API to cache data -->
                <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
                <!-- Use GPS for device location -->
                <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
                <!-- Use Wi-Fi or mobile connection for device location -->
                <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
                <!-- Allows the API to access Google web-based services -->
                <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
                <!-- Specify OpenGL ES 2.0 as a requirement -->
                <uses-feature android:glEsVersion="0x00020000" android:required="true"/>
                <!-- Replace <com.domain.appid> with your application ID -->
                <uses-permission android:name="com.three.pi.anatolia.permission.MAPS_RECEIVE" />
                <permission android:name="com.three.pi.anatolia.permission.MAPS_RECEIVE" android:protectionLevel="signature"/>
                    <meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="my production key here" />
        <!-- Action Bar -->
            <module platform="android" version="0.2">net.iamyellow.gcmjs</module>
            <module platform="android">ti.map</module>
            <target device="android">true</target>
            <target device="blackberry">false</target>
            <target device="ipad">true</target>
            <target device="iphone">true</target>
            <target device="mobileweb">true</target>
            <target device="tizen">false</target>
            <plugin version="1.0">ti.alloy</plugin>
    — answered November 21st 2013 by Christos Gkrezios
  • Hi Christos,

    Just to make sure, did you check here. If not, you should most certainly take a look. Let me know if it helps.

    — answered November 21st 2013 by Paulo Dichone
    1 Comment
    • Hi Paulo,
      thank you for your answer. I did checked on this link and this was my guideline to complete the process but still have the problem. I will now try to make a new app and make everything from the bottom up. I will be back with the results. I suspect the problem is in the certificate.

      — commented November 23rd 2013 by Christos Gkrezios
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.