To Create Android Application by using Google Maps Android API v2 -


i want build android application uses google maps android api v2. so, followed link -link. following steps prescribed in link, able generate api key. further after completing steps tried run app. faced following error.

04-05 10:01:56.442: e/androidruntime(6170): fatal exception: main 04-05 10:01:56.442: e/androidruntime(6170): java.lang.runtimeexception: unable start activity componentinfo{com.example.task/com.example.task.mainactivity}: android.view.inflateexception: binary xml file line #5: error inflating class fragment 04-05 10:01:56.442: e/androidruntime(6170):     @ android.app.activitythread.performlaunchactivity(activitythread.java:2142) 04-05 10:01:56.442: e/androidruntime(6170):     @ android.app.activitythread.handlelaunchactivity(activitythread.java:2167) 04-05 10:01:56.442: e/androidruntime(6170):     @ android.app.activitythread.access$600(activitythread.java:134) 04-05 10:01:56.442: e/androidruntime(6170):     @ android.app.activitythread$h.handlemessage(activitythread.java:1278) 04-05 10:01:56.442: e/androidruntime(6170):     @ android.os.handler.dispatchmessage(handler.java:99) 04-05 10:01:56.442: e/androidruntime(6170):     @ android.os.looper.loop(looper.java:150) 04-05 10:01:56.442: e/androidruntime(6170):     @ android.app.activitythread.main(activitythread.java:4831) 04-05 10:01:56.442: e/androidruntime(6170):     @ java.lang.reflect.method.invokenative(native method) 04-05 10:01:56.442: e/androidruntime(6170):     @ java.lang.reflect.method.invoke(method.java:511) 04-05 10:01:56.442: e/androidruntime(6170):     @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:786) 04-05 10:01:56.442: e/androidruntime(6170):     @ com.android.internal.os.zygoteinit.main(zygoteinit.java:553) 04-05 10:01:56.442: e/androidruntime(6170):     @ dalvik.system.nativestart.main(native method) 04-05 10:01:56.442: e/androidruntime(6170): caused by: android.view.inflateexception: binary xml file line #5: error inflating class fragment 04-05 10:01:56.442: e/androidruntime(6170):     @ android.view.layoutinflater.createviewfromtag(layoutinflater.java:704) 04-05 10:01:56.442: e/androidruntime(6170):     @ android.view.layoutinflater.rinflate(layoutinflater.java:746) 04-05 10:01:56.442: e/androidruntime(6170):     @ android.view.layoutinflater.inflate(layoutinflater.java:489) 04-05 10:01:56.442: e/androidruntime(6170):     @ android.view.layoutinflater.inflate(layoutinflater.java:396) 04-05 10:01:56.442: e/androidruntime(6170):     @ android.view.layoutinflater.inflate(layoutinflater.java:352) 04-05 10:01:56.442: e/androidruntime(6170):     @ com.android.internal.policy.impl.phonewindow.setcontentview(phonewindow.java:257) 04-05 10:01:56.442: e/androidruntime(6170):     @ android.app.activity.setcontentview(activity.java:1867) 04-05 10:01:56.442: e/androidruntime(6170):     @ com.example.task.mainactivity.oncreate(mainactivity.java:14) 04-05 10:01:56.442: e/androidruntime(6170):     @ android.app.activity.performcreate(activity.java:5008) 04-05 10:01:56.442: e/androidruntime(6170):     @ android.app.instrumentation.callactivityoncreate(instrumentation.java:1079) 04-05 10:01:56.442: e/androidruntime(6170):     @ android.app.activitythread.performlaunchactivity(activitythread.java:2106) 04-05 10:01:56.442: e/androidruntime(6170):     ... 11 more 04-05 10:01:56.442: e/androidruntime(6170): caused by: android.app.fragment$instantiationexception: unable instantiate fragment com.google.android.gms.maps.mapfragment: make sure class name exists, public, , has empty constructor public 04-05 10:01:56.442: e/androidruntime(6170):     @ android.app.fragment.instantiate(fragment.java:584) 04-05 10:01:56.442: e/androidruntime(6170):     @ android.app.fragment.instantiate(fragment.java:552) 04-05 10:01:56.442: e/androidruntime(6170):     @ android.app.activity.oncreateview(activity.java:4656) 04-05 10:01:56.442: e/androidruntime(6170):     @ android.view.layoutinflater.createviewfromtag(layoutinflater.java:680) 04-05 10:01:56.442: e/androidruntime(6170):     ... 21 more 04-05 10:01:56.442: e/androidruntime(6170): caused by: java.lang.classnotfoundexception: com.google.android.gms.maps.mapfragment 04-05 10:01:56.442: e/androidruntime(6170):     @ dalvik.system.basedexclassloader.findclass(basedexclassloader.java:61) 04-05 10:01:56.442: e/androidruntime(6170):     @ java.lang.classloader.loadclass(classloader.java:501) 04-05 10:01:56.442: e/androidruntime(6170):     @ java.lang.classloader.loadclass(classloader.java:461) 04-05 10:01:56.442: e/androidruntime(6170):     @ android.app.fragment.instantiate(fragment.java:574) 04-05 10:01:56.442: e/androidruntime(6170):     ... 24 more 

error might because of com.google.android.gms.maps.mapfragment package in main.xml . have com.google.android.gms package in dut not able find com.google.android.gms.maps.mapfragment. how can know whether package in dut or not , solution error.

mapfragment part of google-play-services library. use need import google-play-services workspace , reference project, can reed how it's done in first 3 steps of blog post wrote:

google maps api v2


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -