android - Map View not working -
hi newbie android development trying integrate map view in application , giving error.i have obtained api key , have double checked it. have pasted code along layout file , log file.can please.? thanks.
mainactivity.java package com.vitarkasolutions.tracker; import android.os.bundle; import com.google.android.gms.maps.mapview; import com.google.android.maps.mapactivity; public class mainactivity extends mapactivity { mapview mapview; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); mapview=(mapview)findviewbyid(r.id.mymapview); } @override protected boolean isroutedisplayed() { // todo auto-generated method stub return false; } } activity_main.xml <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" tools:context=".mainactivity" > <textview android:id="@+id/cordinates " android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparenttop="true" android:text="your location x- , y- " /> <button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignright="@+id/cordinates " android:layout_aligntop="@+id/cordinates " android:layout_marginright="46dp" android:layout_margintop="56dp" android:text="button" /> <com.google.android.maps.mapview android:id="@+id/mymapview" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_alignparentleft="true" android:layout_below="@+id/button1" android:layout_margintop="24dp" android:apikey="mymapkey" android:clickable="true" android:enabled="true" > </com.google.android.maps.mapview> </relativelayout> logcat 04-06 17:56:28.489: e/androidruntime(1798): fatal exception: main 04-06 17:56:28.489: e/androidruntime(1798): java.lang.runtimeexception: unable instantiate activity componentinfo{com.vitarkasolutions.tracker/com.vitarkasolutions.tracker.mainactivity}: java.lang.classnotfoundexception: didn't find class "com.vitarkasolutions.tracker.mainactivity" on path: dexpathlist[[zip file "/data/app/com.vitarkasolutions.tracker-2.apk"],nativelibrarydirectories=[/data/app-lib/com.vitarkasolutions.tracker-2, /vendor/lib, /system/lib]] 04-06 17:56:28.489: e/androidruntime(1798): @ android.app.activitythread.performlaunchactivity(activitythread.java:2277) 04-06 17:56:28.489: e/androidruntime(1798): @ android.app.activitythread.handlelaunchactivity(activitythread.java:2403) 04-06 17:56:28.489: e/androidruntime(1798): @ android.app.activitythread.access$600(activitythread.java:165) 04-06 17:56:28.489: e/androidruntime(1798): @ android.app.activitythread$h.handlemessage(activitythread.java:1373) 04-06 17:56:28.489: e/androidruntime(1798): @ android.os.handler.dispatchmessage(handler.java:107) 04-06 17:56:28.489: e/androidruntime(1798): @ android.os.looper.loop(looper.java:194) 04-06 17:56:28.489: e/androidruntime(1798): @ android.app.activitythread.main(activitythread.java:5391) 04-06 17:56:28.489: e/androidruntime(1798): @ java.lang.reflect.method.invokenative(native method) 04-06 17:56:28.489: e/androidruntime(1798): @ java.lang.reflect.method.invoke(method.java:525) 04-06 17:56:28.489: e/androidruntime(1798): @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:833) 04-06 17:56:28.489: e/androidruntime(1798): @ com.android.internal.os.zygoteinit.main(zygoteinit.java:600) 04-06 17:56:28.489: e/androidruntime(1798): @ dalvik.system.nativestart.main(native method) 04-06 17:56:28.489: e/androidruntime(1798): caused by: java.lang.classnotfoundexception: didn't find class "com.vitarkasolutions.tracker.mainactivity" on path: dexpathlist[[zip file "/data/app/com.vitarkasolutions.tracker-2.apk"],nativelibrarydirectories=[/data/app-lib/com.vitarkasolutions.tracker-2, /vendor/lib, /system/lib]] 04-06 17:56:28.489: e/androidruntime(1798): @ dalvik.system.basedexclassloader.findclass(basedexclassloader.java:53) 04-06 17:56:28.489: e/androidruntime(1798): @ java.lang.classloader.loadclass(classloader.java:501) 04-06 17:56:28.489: e/androidruntime(1798): @ java.lang.classloader.loadclass(classloader.java:461) 04-06 17:56:28.489: e/androidruntime(1798): @ android.app.instrumentation.newactivity(instrumentation.java:1119) 04-06 17:56:28.489: e/androidruntime(1798): @ android.app.activitythread.performlaunchactivity(activitythread.java:2268) 04-06 17:56:28.489: e/androidruntime(1798): ... 11 more
that line should you:
"caused by: java.lang.classnotfoundexception: didn't find class "com.vitarkasolutions.tracker.mainactivity" on path: dexpathlist[[zip file "/data/app/com.vitarkasolutions.tracker-2.apk"],nativelibrarydirectories=[/data/app- lib/com.vitarkasolutions.tracker-2, /vendor/lib, /system/lib]]"
Comments
Post a Comment