0

I am trying to get google maps working. It is not displaying the map. I get the following error in LogCat

Couldn't get connection factory client

I have been through all the duplicate posts, and made the following changes

  • Ensured that uses-permission and uses-library are inside tag
  • used debug.keystore instead of custom
  • signed up with google maps using my private key, and updated my MapView with the maps key in the xml (for this public post, I have changed it)
  • Exported my app, and used debug.keystore to build it

I am running it on emulator. Maps on emulator works.

Android Manifest

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >
    <uses-library android:name="com.google.android.maps" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
    <activity
        android:name=".MyActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity android:name=".GetLocation" android:label="@string/app_name"/>
</application>

location.xml

<?xml version="1.0" encoding="utf-8"?>
<com.google.android.maps.MapView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:clickable="true"
    android:apiKey="0psLgKtDQLB35-XJXUrjR4bKHIBDRuHu-O-xVhg"
    android:id="@+id/location"
/>

sudo keytool -list -alias androiddebugkey -storepass android -keypass android -keystore     debug.keystore 

returns

androiddebugkey, 20 Mar, 2012, PrivateKeyEntry, 
Certificate fingerprint (MD5): 20:D3:54:D9:F8:70:17:A4:BA:21:5C:98:88:27:45:E0

Fixed I put uses-permission outside of Application tag And uses-library inside of Application tag

Siddharth
  • 9,349
  • 16
  • 86
  • 148

2 Answers2

1

uses-permission outside the <application> Tag. and

Couldn't get connection factory client

And its map-api key problem .And you should create Fresh Map-api key .

Samir Mangroliya
  • 39,918
  • 16
  • 117
  • 134
1

I believe you might have got the solution for this question but for anyone else looking for the help for same question here's the ans

try to put

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

outside your application tag

just leave <uses-library android:name="com.google.android.maps" /> inside the tag

add metadata inside the application tag as

<meta-data android:name="com.google.android.maps.v2.API_KEY"
android:value="your API key"/>

and it will definitely work fine

Maniya Joe
  • 761
  • 6
  • 24