android - Google Maps v2 Error inflating class fragment -


i'm using google maps v2 in application. app crashes starts. min sdk version 8 , max 19. can't error is. below logcat , code, please help

log

03-10 16:17:37.977: e/androidruntime(24296): fatal exception: main 03-10 16:17:37.977: e/androidruntime(24296): java.lang.runtimeexception: unable start activity componentinfo{com.appscourt.earth.map.location/com.appscourt.earth.map.location.mainactivity}: android.view.inflateexception: binary xml file line #11: error inflating class fragment 03-10 16:17:37.977: e/androidruntime(24296):    @ android.app.activitythread.performlaunchactivity(activitythread.java:2136) 03-10 16:17:37.977: e/androidruntime(24296):    @ android.app.activitythread.handlelaunchactivity(activitythread.java:2174) 03-10 16:17:37.977: e/androidruntime(24296):    @ android.app.activitythread.access$700(activitythread.java:141) 03-10 16:17:37.977: e/androidruntime(24296):    @ android.app.activitythread$h.handlemessage(activitythread.java:1267) 03-10 16:17:37.977: e/androidruntime(24296):    @ android.os.handler.dispatchmessage(handler.java:99) 03-10 16:17:37.977: e/androidruntime(24296):    @ android.os.looper.loop(looper.java:137) 03-10 16:17:37.977: e/androidruntime(24296):    @ android.app.activitythread.main(activitythread.java:5059) 03-10 16:17:37.977: e/androidruntime(24296):    @ java.lang.reflect.method.invokenative(native method) 03-10 16:17:37.977: e/androidruntime(24296):    @ java.lang.reflect.method.invoke(method.java:511) 03-10 16:17:37.977: e/androidruntime(24296):    @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:792) 03-10 16:17:37.977: e/androidruntime(24296):    @ com.android.internal.os.zygoteinit.main(zygoteinit.java:555) 03-10 16:17:37.977: e/androidruntime(24296):    @ dalvik.system.nativestart.main(native method) 03-10 16:17:37.977: e/androidruntime(24296): caused by: android.view.inflateexception: binary xml file line #11: error inflating class fragment 03-10 16:17:37.977: e/androidruntime(24296):    @ android.view.layoutinflater.createviewfromtag(layoutinflater.java:704) 03-10 16:17:37.977: e/androidruntime(24296):    @ android.view.layoutinflater.rinflate(layoutinflater.java:746) 03-10 16:17:37.977: e/androidruntime(24296):    @ android.view.layoutinflater.inflate(layoutinflater.java:489) 03-10 16:17:37.977: e/androidruntime(24296):    @ android.view.layoutinflater.inflate(layoutinflater.java:396) 03-10 16:17:37.977: e/androidruntime(24296):    @ android.view.layoutinflater.inflate(layoutinflater.java:352) 03-10 16:17:37.977: e/androidruntime(24296):    @ com.android.internal.policy.impl.phonewindow.setcontentview(phonewindow.java:260) 03-10 16:17:37.977: e/androidruntime(24296):    @ android.app.activity.setcontentview(activity.java:1893) 03-10 16:17:37.977: e/androidruntime(24296):    @ com.appscourt.earth.map.location.mainactivity.oncreate(mainactivity.java:31) 03-10 16:17:37.977: e/androidruntime(24296):    @ android.app.activity.performcreate(activity.java:5058) 03-10 16:17:37.977: e/androidruntime(24296):    @ android.app.instrumentation.callactivityoncreate(instrumentation.java:1079) 03-10 16:17:37.977: e/androidruntime(24296):    @ android.app.activitythread.performlaunchactivity(activitythread.java:2100) 03-10 16:17:37.977: e/androidruntime(24296):    ... 11 more 03-10 16:17:37.977: e/androidruntime(24296): caused by: java.lang.securityexception: maps api requires additional following permissions set in androidmanifest.xml ensure correct behavior: 03-10 16:17:37.977: e/androidruntime(24296): <uses-permission android:name="android.permission.access_network_state"/> 03-10 16:17:37.977: e/androidruntime(24296):    @ maps.e.ch.a(unknown source) 03-10 16:17:37.977: e/androidruntime(24296):    @ maps.e.ay.a(unknown source) 03-10 16:17:37.977: e/androidruntime(24296):    @ maps.e.ay.a(unknown source) 03-10 16:17:37.977: e/androidruntime(24296):    @ maps.e.al.a(unknown source) 03-10 16:17:37.977: e/androidruntime(24296):    @ maps.e.bg.a(unknown source) 03-10 16:17:37.977: e/androidruntime(24296):    @ maps.e.bf.a(unknown source) 03-10 16:17:37.977: e/androidruntime(24296):    @ eio.ontransact(sourcefile:107) 03-10 16:17:37.977: e/androidruntime(24296):    @ android.os.binder.transact(binder.java:326) 03-10 16:17:37.977: e/androidruntime(24296):    @ com.google.android.gms.maps.internal.imapfragmentdelegate$a$a.oncreateview(unknown source) 03-10 16:17:37.977: e/androidruntime(24296):    @ com.google.android.gms.maps.supportmapfragment$a.oncreateview(unknown source) 03-10 16:17:37.977: e/androidruntime(24296):    @ com.google.android.gms.dynamic.a$4.b(unknown source) 03-10 16:17:37.977: e/androidruntime(24296):    @ com.google.android.gms.dynamic.a.a(unknown source) 03-10 16:17:37.977: e/androidruntime(24296):    @ com.google.android.gms.dynamic.a.oncreateview(unknown source) 03-10 16:17:37.977: e/androidruntime(24296):    @ com.google.android.gms.maps.supportmapfragment.oncreateview(unknown source) 03-10 16:17:37.977: e/androidruntime(24296):    @ android.support.v4.app.fragment.performcreateview(fragment.java:1500) 03-10 16:17:37.977: e/androidruntime(24296):    @ android.support.v4.app.fragmentmanagerimpl.movetostate(fragmentmanager.java:900) 03-10 16:17:37.977: e/androidruntime(24296):    @ android.support.v4.app.fragmentmanagerimpl.movetostate(fragmentmanager.java:1082) 03-10 16:17:37.977: e/androidruntime(24296):    @ android.support.v4.app.fragmentmanagerimpl.addfragment(fragmentmanager.java:1184) 03-10 16:17:37.977: e/androidruntime(24296):    @ android.support.v4.app.fragmentactivity.oncreateview(fragmentactivity.java:291) 03-10 16:17:37.977: e/androidruntime(24296):    @ android.view.layoutinflater.createviewfromtag(layoutinflater.java:676) 

xml file

<fragment         android:id="@+id/map"         android:layout_width="match_parent"         android:layout_height="match_parent"         android:layout_marginbottom="35dip"         android:name="com.google.android.gms.maps.supportmapfragment" /> 

mainactivity.java

public class mainactivity extends fragmentactivity implements         loadercallbacks<cursor> { ....     private void initializemap() {          if (gmap == null) {          gmap = ((supportmapfragment) getsupportfragmentmanager().findfragmentbyid(                 r.id.map)).getmap();         // check if map created or not         if (gmap == null) {             toast.maketext(getapplicationcontext(),                     "sorry! unable create maps", toast.length_short)                     .show();         }     } } 

your logcat said:

 caused by: java.lang.securityexception: maps api requires additional following permissions set in androidmanifest.xml    ensure correct behavior: 03-10 16:17:37.977: e/androidruntime(24296):   <uses-permission android:name="android.permission.access_network_state"/> 

you need add permission in manifest.xml

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

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -