i new android , trying develop android app includes google maps. app working fine on emulator until decided update google play services revision 7 9.
i same error encountered before ("google play services out of date..."), plus "fatal exception: main" error. here in logcat:
http://imageshack.us/a/img11/8117/y1mq.png
if read logcat correctly, error in maptabactivity don't know if error caused google play services being out of date or if it's else...
before updating google play services, app working on emulator
- nexus 4 device
- android 4.2.2(api lvl 17)
- arm cpu
- host gpu selected
i had install com.android.vending.apk , com.google.android.gms.apk recommend in other posts this.
i added permission necessary manifest , applied api key included in manifest.
can me? here's maptabactivity , corresponding xml.
maptabactivity.java
package com.dissertation.closethedoordiss; import com.google.android.gms.maps.cameraupdatefactory; import com.google.android.gms.maps.googlemap; import com.google.android.gms.maps.supportmapfragment; import com.google.android.gms.maps.model.latlng; import android.content.intent; import android.os.bundle; import android.support.v4.app.fragmentactivity; import android.view.view; public class maptabactivity extends fragmentactivity { private googlemap mmap; private static final latlng bristol = new latlng(51.455083,-2.586903); @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_maptab); mmap = ((supportmapfragment) getsupportfragmentmanager().findfragmentbyid(r.id.mapview)).getmap(); mmap.setmaptype(googlemap.map_type_normal); mmap.movecamera(cameraupdatefactory.newlatlngzoom(bristol, 13)); } public void onclick_addretailer (view view) { startactivity(new intent("com.closethedoordiss.addretaileractivity")); } } activity_maptab.xml
<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:map="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> <fragment android:name="com.google.android.gms.maps.supportmapfragment" android:id="@+id/mapview" android:layout_width="match_parent" android:layout_height="match_parent" /> <imagebutton android:id="@+id/imagebutton1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentright="true" android:src="@android:drawable/ic_menu_add" android:onclick="onclick_addretailer" android:contentdescription="@string/add_button" /> </relativelayout> thanks in advance provided.
the way have found run google maps android api v2 on physical device.
i running app on samsung galaxy s duos android 4.0.4 , map displaying correctly.
after trying several solutions, including testing several emulator configurations , installing different apks, believe easiest way overcome "google play services out of date" issue when comes using google maps api v2 on emulator develop/test on physical device.
hope helps.
Comments
Post a Comment