2

I am trying to add Map functionality to my app. My IDE is AndroidStudio. I've gone to the SDK Manager and installed both Google Play services and Google repository.

Then, in my gradle file, I've added google play services:

dependencies {
    compile 'com.android.support:appcompat-v7:+'
    compile 'com.android.support:support-v4:19.1.+'
    compile 'com.google.android.gms:play-services:4.3.23'
    compile fileTree(dir: 'libs', include: ['*.jar'])
}

After this, I've synced the project with the gradle files.

In my fragment, I've added MapView (and my API key). No error during compile, however, I get this during runtime:

Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.maps.MapView" on path: DexPathList[[zip file "/data/app/com.app.app-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.blueforcemedia.blueforcetracker-1, /vendor/lib, /system/lib]]
            at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
    }

What am I doing wrong?

0xSina
  • 20,973
  • 34
  • 136
  • 253

2 Answers2

0

The library was provided during the compile, but it's not present at runtime. Your application is trying to invoke a method from library which is not present.

Kasper Ziemianek
  • 1,329
  • 8
  • 15
0

Once i have got this exception for not adding the launcher icon in the manifest.xml(tag) and also for not setting up the target project properties correctly.

Chandru
  • 5,954
  • 11
  • 45
  • 85