Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

package com.google.android.maps does not exist Android Studio

I've been working on a project which includes maps, however I made an error and I have had to create a new project. I have copied across all my classes, res folders, libraries etc. However now I am getting 101 ERRORS!!

There are all a knock on of this:

package com.google.maps does not exist.

I have selected a target google api:

Target SDK

I've included the jar files as dependencies as follows:

dependencies

It was working fine in my previous project but now that I have had to create a new project it doesn't work. I'm obviously omitting something but I can't think of what. I am using Android Studio and it is a gradle build

If someone could help me I would really appreciate it because it is extremely frustrating...

Oh and I have it declared in my manifest

<uses-library android:name="com.google.android.maps" />

so please, if anyone has come across this before I'd appreciate it. I've already searched online and checked out this:

http://code.davidjanes.com/blog/2009/11/13/18-hours-of-jar-hell-with-android-google-maps/

although helpful it told me what I already knew...so please please help!!

EDIT

Ok, I know what the problem is, I just don't know how to fix it. I am referencing maps.jar, however, in this project there is no maps.jar, in my previous project there was in the external library. The external library had Android 4.1.2 Google APIs and included there was maps.jar, however, I can't seem to create a project with the external library containing that, I don't know why. I have tried to change the build target by going file -> other setting -> default project structure and changing it there but it doesn't work...can anyone suggest what I might need to do to ensure if I create a project to have the Google APIs included in the external library? Or what changes I need to make to my current project

like image 523
DJ-DOO Avatar asked Feb 19 '14 21:02

DJ-DOO


1 Answers

Add the following code to build.gradle file

dependencies {
...
compile 'com.google.android.gms:play-services-base:7.3.0'
compile 'com.google.android.gms:play-services-location:7.3.0'
...
}
like image 60
Sumukh Bhandarkar Avatar answered Nov 14 '22 23:11

Sumukh Bhandarkar