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?