0

I'm working on an android project in which one of the activities includes a Maps view. I'm only after doing the code for displaying a simple Google Map but I bumped into this NoClassDefFoundError. I have checked some similar questions and tried the suggested solutions but still won't work. I have activated the Internet permision in the manifest file and the user library for the application. Does anyone have any suggestions on what might be the problem? Here's the activity code:

package com.mad.mylit;
import android.os.Bundle;

import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;

public class LocationsActivity extends MapActivity {

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.location);
    }

    @Override
    protected boolean isRouteDisplayed() {
        // TODO Auto-generated method stub
        return false;
    }
}

And here's my manifest file:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.mad.mylit"
    android:versionCode="1"
    android:versionName="1.0" android:installLocation="auto">

    <uses-sdk android:minSdkVersion="10" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.INTERNET"/>

    <application
        android:icon="@drawable/icon"
        android:label="@string/app_name" >
        <uses-library android:name="com.google.android.maps"/>
        <activity
            android:name=".MyLitActivity"
            android:label="@string/app_name"
            >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".MapsActivity"></activity>
        <activity android:name=".MyProfileActivity"></activity>
        <activity android:name=".BusActivity"></activity>
        <activity android:name=".EventsActivity"></activity>
        <activity android:name=".LocationsActivity"></activity>
        <activity android:name=".NotesActivity"></activity>
        <activity android:name=".TimetableActivity"></activity>
        <activity android:name=".MondayActivity"></activity>
        <activity android:name=".TuesdayActivity"></activity>
        <activity android:name=".WednesdayActivity"></activity>
        <activity android:name=".ThursdayActivity"></activity>
        <activity android:name=".FridayActivity"></activity>
        <activity android:name=".CaherdavinActivity"></activity>
        <activity android:name=".RaheenActivity"></activity>
        <activity android:name=".UniversityActivity"></activity>
        <activity android:name=".SplashScreen"
              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>

All of the activities are in the same package.

dave.c
  • 10,910
  • 5
  • 39
  • 62
  • Why do you have two Launcher activities? – San Apr 20 '12 at 15:56
  • Oh, I was meant to remove the first one. I added a splash screen for the application. I was meant to clean up the project after I finish it. I don't think that is the problem though. All the other activities work just fine. – boolean.chick Apr 20 '12 at 15:58

2 Answers2

0

Try to get new maps API key with your personal keystore.

vtuhtan
  • 1,056
  • 7
  • 18
  • But it will generate the same key since it's the same MD5 fingerprint and same google account. – boolean.chick Apr 20 '12 at 17:25
  • I thought if you were using debug.keystore try to create your own keystore and dhan MD5 fingerprint.. But, I don't think that could be a solution to the problem. – vtuhtan Apr 20 '12 at 17:55
  • No, I just tried getting a key from a different google account and the project still has the same problem. Thanks anyway. :) – boolean.chick Apr 20 '12 at 18:23
0

Have you recently updated your ADT plugin?

Here and here are some talks about same prblem..

Community
  • 1
  • 1
vtuhtan
  • 1,056
  • 7
  • 18
  • My ADT is up to date. I fixed the problem though. I created another project and just copied all my code and it worked. I think there was an issue with the way I created the project. Not sure what happened. – boolean.chick Apr 26 '12 at 02:03