Note that there are some explanatory texts on larger screens.

plurals
  1. POcan't run the google map feature in android
    text
    copied!<p>I'm trying to use the google maps feature in android. I followed the instructions at <a href="https://developers.google.com/maps/documentation/android/hello-mapview" rel="nofollow">https://developers.google.com/maps/documentation/android/hello-mapview</a>. But when I run the app, there seems to be some kind of problem. I'm not sure what it is but the app won't load. Here is the errors listed in the logcat.</p> <pre><code>07-26 02:01:01.771: ERROR/AndroidRuntime(158): ERROR: thread attach failed 07-26 02:01:06.761: ERROR/AndroidRuntime(211): Uncaught handler: thread main exiting due to uncaught exception 07-26 02:01:06.841: ERROR/AndroidRuntime(211): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.trainingcenter.maps/com.trainingcenter.maps.HelloGoogleMaps}: java.lang.ClassNotFoundException: com.trainingcenter.maps.HelloGoogleMaps in loader dalvik.system.PathClassLoader@43b7d958 07-26 02:01:06.841: ERROR/AndroidRuntime(211): Caused by: java.lang.ClassNotFoundException: com.trainingcenter.maps.HelloGoogleMaps in loader dalvik.system.PathClassLoader@43b7d958 07-26 02:01:06.931: ERROR/dalvikvm(211): Unable to open stack trace file '/data/anr/traces.txt': Permission denied 07-26 02:01:17.400: ERROR/AndroidRuntime(242): ERROR: thread attach failed 07-26 02:01:26.391: ERROR/ActivityThread(63): Failed to find provider info for com.google.settings 07-26 02:02:24.580: ERROR/AndroidRuntime(323): ERROR: thread attach failed 07-26 02:07:12.640: ERROR/AndroidRuntime(417): Uncaught handler: thread main exiting due to uncaught exception 07-26 02:07:12.640: ERROR/AndroidRuntime(417): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.trainingcenter.maps/com.trainingcenter.maps.HelloGoogleMaps}: java.lang.ClassNotFoundException: com.trainingcenter.maps.HelloGoogleMaps in loader dalvik.system.PathClassLoader@43d02ee8 07-26 02:07:12.640: ERROR/AndroidRuntime(417): Caused by: java.lang.ClassNotFoundException: com.trainingcenter.maps.HelloGoogleMaps in loader dalvik.system.PathClassLoader@43d02ee8 </code></pre> <p>Can you tell me what's wrong? Thanks for the help.</p> <p>Here is the android 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.trainingcenter.maps" android:versionCode="1" android:versionName="1.0"&gt; &lt;uses-sdk android:minSdkVersion="7" /&gt; &lt;uses-library android:name="com.google.android.maps" /&gt; &lt;uses-permission android:name="android.permission.INTERNET" /&gt; &lt;application android:icon="@drawable/icon" android:label="@string/app_name"&gt; &lt;activity android:name=".HelloGoogleMaps" android:label="@string/app_name" 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; </code></pre> <p></p> <p>Here is the activity</p> <pre><code>package com.trainingcenter.maps; import android.os.Bundle; import com.google.android.maps.MapActivity; import com.google.android.maps.MapView; public class HelloGoogleMaps 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>Here's the main.xml file</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;com.google.android.maps.MapView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/mapview" android:layout_width="fill_parent" android:layout_height="fill_parent" android:clickable="true" android:apiKey="I inserted the API key here, I got it from http://code.google.com/android/maps-api-signup.html" /&gt; </code></pre> <p>Btw, I'm using Google API level 2.1 update 1</p>
 

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