unable to use com.google.android.maps in the xml file

Niklons

New Member
i am designing an app that uses google maps. In order to get maps i have put the following code\[code\] com.google.android.maps.MapView android:id="@+id/mapview" android:layout_width="fill_parent" android:layout_height="wrap_content" android:clickable="true" android:apiKey="0V1xMgGND8LqWx0wO3Vkgs8Rj27aVCRp0biowfw" />\[/code\]in the xml file but the app force closes after running it.If i don't use this part , then the rest of the code executes all fine.[*]used google APIs 2.3 as target[*]sdk version 1.6[*]using Eclipse IDE for Java Developers Version: Indigo Service Release 2Build id: 20120216-1857[*]i have put within theapplication tag in the manifest file.[*]I have even used the permissions I can however compile it without any errors but unable to run it.I cant really figure it out.this is the log generated by the logcat.can i get some help from anyone...?\[code\] 04-29 22:14:32.553: D/dalvikvm(415): GC_CONCURRENT freed 261K, 48% free 2963K/5639K, external 411K/517K, paused 5ms+5ms 04-29 22:14:32.863: D/dalvikvm(415): GC_CONCURRENT freed 447K, 49% free 3086K/5959K, external 411K/517K, paused 5ms+7ms 04-29 22:14:33.133: D/dalvikvm(415): GC_CONCURRENT freed 326K, 46% free 3271K/6023K, external 411K/517K, paused 5ms+6ms 04-29 22:14:33.203: D/AndroidRuntime(415): Shutting down VM 04-29 22:14:33.203: W/dalvikvm(415): threadid=1: thread exiting with uncaught exception (group=0x40015560) 04-29 22:14:33.303: E/AndroidRuntime(415): FATAL EXCEPTION: main 04-29 22:14:33.303: E/AndroidRuntime(415): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.my.map/com.my.map.MapActivity}: android.view.InflateException: Binary XML file line #6: Error inflating class com.google.android.maps.MapView 04-29 22:14:33.303: E/AndroidRuntime(415): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647) 04-29 22:14:33.303: E/AndroidRuntime(415): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663) 04-29 22:14:33.303: E/AndroidRuntime(415): at android.app.ActivityThread.access$1500(ActivityThread.java:117) 04-29 22:14:33.303: E/AndroidRuntime(415): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931) 04-29 22:14:33.303: E/AndroidRuntime(415): at android.os.Handler.dispatchMessage(Handler.java:99) 04-29 22:14:33.303: E/AndroidRuntime(415): at android.os.Looper.loop(Looper.java:130) 04-29 22:14:33.303: E/AndroidRuntime(415): at android.app.ActivityThread.main(ActivityThread.java:3683) 04-29 22:14:33.303: E/AndroidRuntime(415): at java.lang.reflect.Method.invokeNative(Native Method) 04-29 22:14:33.303: E/AndroidRuntime(415): at java.lang.reflect.Method.invoke(Method.java:507) 04-29 22:14:33.303: E/AndroidRuntime(415): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:839) 04-29 22:14:33.303: E/AndroidRuntime(415): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 04-29 22:14:33.303: E/AndroidRuntime(415): at dalvik.system.NativeStart.main(Native Method) 04-29 22:14:33.303: E/AndroidRuntime(415): Caused by: android.view.InflateException: Binary XML file line #6: Error inflating class com.google.android.maps.MapView 04-29 22:14:33.303: E/AndroidRuntime(415): at android.view.LayoutInflater.createView(LayoutInflater.java:518) 04-29 22:14:33.303: E/AndroidRuntime(415): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:570) 04-29 22:14:33.303: E/AndroidRuntime(415): at android.view.LayoutInflater.rInflate(LayoutInflater.java:623) 04-29 22:14:33.303: E/AndroidRuntime(415): at android.view.LayoutInflater.inflate(LayoutInflater.java:408) 04-29 22:14:33.303: E/AndroidRuntime(415): at android.view.LayoutInflater.inflate(LayoutInflater.java:320) 04-29 22:14:33.303: E/AndroidRuntime(415): at android.view.LayoutInflater.inflate(LayoutInflater.java:276) 04-29 22:14:33.303: E/AndroidRuntime(415): at com.android.internal.policy.impl.PhoneWindow.setContentView (PhoneWindow.java:207) 04-29 22:14:33.303: E/AndroidRuntime(415): at android.app.Activity.setContentView(Activity.java:1657) 04-29 22:14:33.303: E/AndroidRuntime(415): at com.my.map.MapActivity.onCreate(MapActivity.java:17) 04-29 22:14:33.303: E/AndroidRuntime(415): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 04-29 22:14:33.303: E/AndroidRuntime(415): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611) 04-29 22:14:33.303: E/AndroidRuntime(415): ... 11 more 04-29 22:14:33.303: E/AndroidRuntime(415): Caused by: java.lang.reflect.InvocationTargetException 04-29 22:14:33.303: E/AndroidRuntime(415): at java.lang.reflect.Constructor.constructNative(Native Method) 04-29 22:14:33.303: E/AndroidRuntime(415): at java.lang.reflect.Constructor.newInstance(Constructor.java:415) 04-29 22:14:33.303: E/AndroidRuntime(415): at android.view.LayoutInflater.createView(LayoutInflater.java:505) 04-29 22:14:33.303: E/AndroidRuntime(415): ... 21 more 04-29 22:14:33.303: E/AndroidRuntime(415): Caused by: java.lang.IllegalArgumentException: MapViews can only be created insideinstances ofMapActivity. 04-29 22:14:33.303: E/AndroidRuntime(415): at com.google.android.maps.MapView.<init>(MapView.java:291) 04-29 22:14:33.303: E/AndroidRuntime(415): at com.google.android.maps.MapView.<init>(MapView.java:264) 04-29 22:14:33.303: E/AndroidRuntime(415): at com.google.android.maps.MapView.<init>(MapView.java:247) 04-29 22:14:33.303: E/AndroidRuntime(415): ... 24 more 04-29 22:14:45.193: I/Process(415): Sending signal. PID: 415 SIG: 9**\[/code\]
 
Back
Top