Note that there are some explanatory texts on larger screens.

plurals
  1. POGoogle Maps crashes
    text
    copied!<p>For some reason I can't get MapView working. I've spend a couple of days doining research to it, and my code looking good (which means it's looks exactly like different tutorials), but everytime I launch it, it crashes. Eclipse nor the console info won't display an error.</p> <p>Does anyone has a solution?</p> <p>The HelloMapActivity.java file:</p> <pre><code>package com.com.google.maps; import com.google.android.maps.MapActivity; import com.google.android.maps.MapView; import android.os.Bundle; public class HelloMapActivity extends MapActivity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); MapView mapView = (MapView) findViewById(R.id.mapview); mapView.setBuiltInZoomControls(true); } @Override protected boolean isRouteDisplayed() { // TODO Auto-generated method stub return false; } } </code></pre> <p>The main.xml file:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"&gt; &lt;com.google.android.maps.MapView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/mapview" android:clickable="true" android:enabled="true" android:apiKey="&lt;Api-key&gt;" /&gt; &lt;/RelativeLayout&gt; </code></pre> <p>And at last, the Manifest:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.com.google.maps" android:versionCode="1" android:versionName="1.0" &gt; &lt;uses-sdk android:minSdkVersion="7" /&gt; &lt;application android:icon="@drawable/ic_launcher" android:label="@string/app_name" &gt; &lt;uses-library android:name="com.google.android.maps" /&gt; &lt;activity android:label="@string/app_name" android:name=".HelloMapActivity" android:theme="@android:style/Theme.NoTitleBar"&gt; &lt;intent-filter &gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;/application&gt; &lt;uses-permission android:name="android.permission.INTERNET" /&gt; &lt;/manifest&gt; </code></pre> <p>This said LogCat:</p> <pre><code>11-01 22:22:56.376: D/ddm-heap(193): Got feature list request 11-01 22:22:56.826: W/dalvikvm(193): Class resolved by unexpected DEX: Lcom/com/google/maps/HelloMapActivity;(0x6285ff78):0x11f940 ref [Lcom/google/android/maps/MapActivity;] Lcom/google/android/maps/MapActivity;(0x6285ff78):0x11ee40 11-01 22:22:56.826: W/dalvikvm(193): (Lcom/com/google/maps/HelloMapActivity; had used a different Lcom/google/android/maps/MapActivity; during pre-verification) 11-01 22:22:56.826: W/dalvikvm(193): Unable to resolve superclass of Lcom/com/google/maps/HelloMapActivity; (41) 11-01 22:22:56.826: W/dalvikvm(193): Link of class 'Lcom/com/google/maps/HelloMapActivity;' failed 11-01 22:22:56.826: D/AndroidRuntime(193): Shutting down VM 11-01 22:22:56.826: W/dalvikvm(193): threadid=3: thread exiting with uncaught exception (group=0x4001b188) 11-01 22:22:56.826: E/AndroidRuntime(193): Uncaught handler: thread main exiting due to uncaught exception 11-01 22:22:56.877: E/AndroidRuntime(193): java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation 11-01 22:22:56.877: E/AndroidRuntime(193): at dalvik.system.DexFile.defineClass(Native Method) 11-01 22:22:56.877: E/AndroidRuntime(193): at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:209) 11-01 22:22:56.877: E/AndroidRuntime(193): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:203) 11-01 22:22:56.877: E/AndroidRuntime(193): at java.lang.ClassLoader.loadClass(ClassLoader.java:573) 11-01 22:22:56.877: E/AndroidRuntime(193): at java.lang.ClassLoader.loadClass(ClassLoader.java:532) 11-01 22:22:56.877: E/AndroidRuntime(193): at android.app.Instrumentation.newActivity(Instrumentation.java:1021) 11-01 22:22:56.877: E/AndroidRuntime(193): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2409) 11-01 22:22:56.877: E/AndroidRuntime(193): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512) 11-01 22:22:56.877: E/AndroidRuntime(193): at android.app.ActivityThread.access$2200(ActivityThread.java:119) 11-01 22:22:56.877: E/AndroidRuntime(193): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863) 11-01 22:22:56.877: E/AndroidRuntime(193): at android.os.Handler.dispatchMessage(Handler.java:99) 11-01 22:22:56.877: E/AndroidRuntime(193): at android.os.Looper.loop(Looper.java:123) 11-01 22:22:56.877: E/AndroidRuntime(193): at android.app.ActivityThread.main(ActivityThread.java:4363) 11-01 22:22:56.877: E/AndroidRuntime(193): at java.lang.reflect.Method.invokeNative(Native Method) 11-01 22:22:56.877: E/AndroidRuntime(193): at java.lang.reflect.Method.invoke(Method.java:521) 11-01 22:22:56.877: E/AndroidRuntime(193): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) 11-01 22:22:56.877: E/AndroidRuntime(193): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 11-01 22:22:56.877: E/AndroidRuntime(193): at dalvik.system.NativeStart.main(Native Method) 11-01 22:22:56.916: I/dalvikvm(193): threadid=7: reacting to signal 3 11-01 22:22:56.916: E/dalvikvm(193): Unable to open stack trace file '/data/anr/traces.txt': Permission denied </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload