2

Hi I know this question asked a lot but none of them help me to fix my problem.
I simply want to import this Project to my android Studio but I give this error message

Error:(15, 39) error: package com.google.android.maps does not exist

and this is my SDK:

enter image description here

I try clean , rebuild , invalidate cache but none of them help me.

Community
  • 1
  • 1
max
  • 5,963
  • 12
  • 49
  • 80
  • add google play services as dependency in build.gradle file – R_K Jan 08 '16 at 14:08
  • they add that https://github.com/osmdroid/osmdroid/blob/master/osmdroid-third-party/build.gradle – max Jan 08 '16 at 14:12
  • check http://stackoverflow.com/questions/6284022/package-com-google-android-maps-does-not-exist-intellij http://stackoverflow.com/questions/16748273/android-gradle-how-to-build-for-android-google-apis-4-2-2-not-for-android-4-2-2 – R_K Jan 09 '16 at 05:42

2 Answers2

1

osmdroid contributor here.

osmdroid-android, which is the primary map engine does not require google play services. osmdroid-thirdparty does need since it provides a wrapper for using gmaps with osmdroid apis

if you're building for source: osmdroid can be built with maven (which currently has issue with play services) and gradle. suggest you use gradle with android studio

otherwise use this

dependencies { compile 'org.osmdroid:osmdroid-thirdparty:5.0.1@aar' }

spy
  • 3,199
  • 1
  • 18
  • 26
0

I dont think osmdroid does need googlemaps library. But anyway, have you tried adding google-play-services library to build.gradle?

If you havent you can do this by following steps

  • Click on Project Structure
  • Go to Dependencies Tab
  • Click + button
  • Select com.google.android.gms:play-services and click ok
  • Rebuild the project
Mars Moon
  • 94
  • 2
  • 14
  • Hi thanks for your attention but I want import sample library from osmdroid page in github and in theire sample project yes they add google-play-services https://github.com/osmdroid/osmdroid/blob/master/osmdroid-third-party/build.gradle – max Jan 08 '16 at 14:11