Google Maps Android API v2 with intellij idea

In the attachment, you can see intellij idea does not recognize any of the classes in the com.google.android.gms.maps or com.google.android packages. I have done the following to try to get google maps api working:

1) From SDK Manager, installed Google Play Services, Google Repository, Android Support Library, Android Support Repository
2) Copied google-play-services_lib from /usr/local/android-sdk-linux/extras/google (/usr/local is where I install 3rd party software) to project_root/libs.
3) Then under Project Structure > Modules, made sure google-play-services_lib is there. Selected it, clicked +, Jars and Directories..., and then selected google-play-services.jar. Checked export, Apply and Ok.  
4) Restarted Intellij IDEA

But after that, I still get the compile errors as shown in the screenshot.

How can I successfully import google play services into intellij idea?



Attachment(s):
google maps issues.png
3 comments
Comment actions Permalink

See https://devnet.jetbrains.com/message/5559071#5559071 .

Also, libs folder is for native libraries (.so)

0
Comment actions Permalink

After following the instructions you linked to, it resolved import com.google.android.gms.maps.*, but it did not resolve import com.google.android.maps.*. I attached a screenshot of this issue. Do you know why:

import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;
import com.google.android.maps.Overlay;
import com.google.android.maps.OverlayItem;

cannot be resolved even after adding the module dependency and jar?



Attachment(s):
map-issue.png
0
Comment actions Permalink

Maps is a different library:

SDK_HOME\add-ons\addon-google_apis-google-XX\libs\maps.jar

0

Please sign in to leave a comment.