0

I am making an android app with google maps:-

My steps:-

  1. Main activity extends Fragment activity
  2. Made a copy of Google play services library and imported it to eclipse.Further added a reference of the library to the project.
  3. Enabled the build target of the project to Google API's 4.4.2
  4. Created a browser key on Google API console.
  5. Created an SHA1 certificate for the app in eclipse using the keytool plugin(Also verifies the key using the traditional command prompt technique and both match).
  6. Created an android Api key on Google API console using the SHA1 key obtained

Issue:- I get a blank map on the screen with the zoom in and zoom out buttons

Here is my code:-

activity_main.xml:-

  <fragment

     class="com.google.android.gms.maps.SupportMapFragment"

    android:id="@+id/map"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="@id/spr_place_type"

   />

AndroidManifest.xml :-

     <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
  <uses-feature
        android:glEsVersion="0x00020000"
        android:required="true"/>
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

  <permission
        android:name="com.strangeworld.locations.permission.MAPS_RECEIVE"
        android:protectionLevel="signature"/>

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


        <uses-library
        android:name="com.google.android.maps"/>

        <activity
            android:name="com.strangeworld.locatorapp.MainActivity"
            android:label="@string/app_name" >
            <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.maps.v2.API_KEY"
            android:value="AIzaSyD2LVShEdbQWWV4......"/>

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

Log cat:-

 01-10 10:33:28.059: E/dalvikvm(2440): Could not find class 'maps.ae.i', referenced from method maps.af.al.a
01-10 10:33:30.039: E/GooglePlayServicesUtil(2440): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
01-10 10:33:32.909: E/Google Maps Android API(2440): Authorization failure.  Please see https://developers.google.com/maps/documentation/android/start for how to correctly set up the map.
01-10 10:33:32.929: E/Google Maps Android API(2440): Ensure that the following correspond to what is in the API Console: Package Name: com.example.locations, API Key: AIzaSyAZhJllASbTnr......, Certificate Fingerprint: 83033D1ECACA2C88F9AA2.....
user3146095
  • 419
  • 2
  • 7
  • 25

4 Answers4

0

Your keystore is not appropriate or package name mistake in google api console, recheck once.

VINIL SATRASALA
  • 614
  • 5
  • 11
0

Which type of keystore you are using? If you use debug key and published map looks blank. Use release key to publish.

Google Map Android API v2 can't display map in play store application

Community
  • 1
  • 1
Shadow
  • 6,864
  • 6
  • 44
  • 93
0

mention the entire package name with the key after semicolon ie. com.abcdm.locatorapp

Lal
  • 14,726
  • 4
  • 45
  • 70
0
While generating the key do i need to spicify the whole package name i.e. com.abcdm.locatorapp or just com.abcdm 

Yes you need to mention the package name in the google api console

SHA;complete packagename

Also try regenerating the key

The Google Play services resources were not found. Check your project configuration to ensure that the resources are included

You need to reference the google play servies properly. Check this

Importing google-play-service library showing a red X next to this reference android

Community
  • 1
  • 1
Raghunandan
  • 132,755
  • 26
  • 225
  • 256
  • Well the first part seems to have solved the visibility of the map. Though I still get the error for google play service resources. I cheaked the link too – user3146095 Jan 10 '14 at 07:07
  • @user3146095 if you see the map then it is working fine. Just clean and rebuild – Raghunandan Jan 10 '14 at 07:07
  • I did that too.. i even uninstalled the complete app from my device, clean and rebuild the project and installed it again. But at the runtime i get the same error – user3146095 Jan 10 '14 at 07:09
  • @user3146095 try suggestions by searching on stackoverflow. lots of similar posts. http://stackoverflow.com/questions/18068627/logcat-message-the-google-play-services-resources-were-not-found-check-your-pr. Also test it on a real device – Raghunandan Jan 10 '14 at 07:10
  • @Raghunandan.. already tried all solutions on that page. didnt help though still get the error – user3146095 Jan 10 '14 at 07:17
  • @user3146095 i really don't know what other suggestions i can give – Raghunandan Jan 10 '14 at 07:19