Reputation: 10059
I am getting a com.google.android.maps does not exist error on compile.
But in Eclipse I could use the maps
lib in F:\backup e\Software\Android Eclipse\bundle\sdk\add-ons\addon-google_apis-google-19\libs
.So it doesn't throw the compile error.
But in Android Studio,I don't know how to add the maps lib properly.I have added the maps lib directly to studio but it didn't worked for me.
Gradle Build:
error: package com.google.android.maps does not exist
error: package com.google.android.maps does not exist
error: cannot find symbol class Overlay
error: cannot find symbol class MapView
error: cannot find symbol class MapView
error: method does not override or implement a method from a supertype
error: cannot find symbol variable super
RouteOverlay.java:
import com.google.android.maps.MapView;
import com.google.android.maps.Overlay;
public class RouteOverlay extends Overlay {
@Override
public final void draw(final Canvas canvas, final MapView mapView, final boolean shadow) {
super.draw(canvas, mapView, shadow);
}
}
build.gradle:
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile files('libs/Parse-1.9.3.jar')
compile files('libs/bolts-android-1.2.0.jar')
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.google.android.gms:play-services:7.8.0'
compile 'com.jakewharton.timber:timber:2.4.+'
compile 'com.squareup.retrofit:retrofit:1.6.1'
}
Anyone can help me with this.Thank you.
Upvotes: 1
Views: 2249
Reputation: 3540
You are using old code for Google Maps API v1. the packages are now a bit different: https://developers.google.com/android/reference/com/google/android/gms/maps/package-summary
follow the guide in this (and the other pages on the left, not only this link!): https://developers.google.com/maps/documentation/android/config
Upvotes: 1
Reputation: 339
MapOverlay etc does not supporting in google maps v2.
U have to use default MapFragment
Upvotes: 1