1

When I run my app that has a Google map from Eclispe, the map shows up and all the map functions work..

However, if I share my Eclipse project with a friend OR export my app as an APK and reinstall it on a device, the map doesnt show up. It says:

02-07 00:26:39.644: E/Google Maps Android API(3605): Authorization failure.  Please see https://developers.google.com/maps/documentation/android/start for how to correctly set up the map.

I am not sure whats causing this. Especially because when I(who got the APK from the console and set up everything with my SHA1) run from Eclipse it works correctly?

Here is my XML main.xml with the map fragment

<android.support.v4.widget.DrawerLayout ...... >

<LinearLayout ... >
<RelativeLayout ..>
<Button ... > </Button>
<EditText .. > </EditText>

<fragment
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="20"
class="com.google.android.gms.maps.SupportMapFragment" />
</LinearLayout>

  <ListView android:id="@+id/left_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="0dp"
android:background="#111"/>
</android.support.v4.widget.DrawerLayout>
TaZz
  • 652
  • 7
  • 20

3 Answers3

0

I suspect you have only one key, for debug version. You need another for the release version.

Edit: Reinstall the app afterwards, since there is a known issue that just reuploading (via Eclipse) or updating might not change the manifest, where the key lies.

  • yeah I only have one key. How do I add the debug key? – user2998771 Feb 07 '14 at 16:44
  • If you're using Eclipse, on the last step when exporting a signed APK file you will see the SHA1 key. Take that, create new key, stop the exporting, add the new key, export it with the new key, and you should be done. If you're not using Eclipse, though, you have to find the SHA1 via keytool (I think, correct me if I am wrong). – Yordan Lyubenov Feb 07 '14 at 18:18
0

I had simlilar issue once, you need to go to google console and then go to services and turn Google Maps Android API v2 on

Adam Radomski
  • 2,515
  • 2
  • 17
  • 28
0

For creating the Build(apk) and allow the Google Map to visible in All Devices you have to create Keystore using Release Key.

Check this link

Community
  • 1
  • 1
M A.
  • 949
  • 2
  • 12
  • 29