I saw other topics here with similar symptoms, but none of the answers resolved my issue. I follow the google map viewing guide, http://developer.android.com/resources/tutorials/views/hello-mapview.html and following all the directions exactly, I keep getting this error. Java.lang.ClassNotFoundException: com.goodintechnology.maps.Mymap in the dalvik.system.PathClassLoader loader [/data/app/com.goodintechnology.maps-1.apk]
I started from scratch many times, but every time I change Activity to MapActivity, an error occurs. The purpose of the application is Google API 2.2, and the emulator is the same with GPS enabled. I tried to put the uses-library statement before, after, and in the Application, but that didn't change anything. I even tried to put the statement vertically in the manifest. So, after about 8 hours, messing around with this, I passed it on to all of you. Here is the code:
AndroidManifest.xml
<uses-library android:name="com.google.android.maps" /> <uses-permission android:name="android.permission.INTERNET" /> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".Mymap" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application>
and layout main.xml
<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="My key that was generated on google is here. trust me" /> </LinearLayout>
And the Mymap class
package com.goodintechnology.maps; import com.google.android.maps.MapActivity; import android.os.Bundle; public class Mymap extends MapActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } @Override protected boolean isRouteDisplayed() {
As already mentioned, all this is straight from the Google Map View tutorial.
android android-mapview
Poolczar
source share