包com.google.android.maps不存在“osmdroid”Android Studio

时间:2016-01-08 13:58:24

标签: android android-studio osmdroid

嗨,我知道这个问题很多,但没有一个能帮助我解决问题 我只是想将this Project导入到我的android Studio中,但是我给出了这个错误信息

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

这是我的SDK:

enter image description here

我尝试清理,重建,使缓存无效,但它们都没有帮助我。

2 个答案:

答案 0 :(得分:1)

osmdroid撰稿人。

osmdroid-android,这是主要的地图引擎,不需要谷歌播放服务。 osmdroid-thirdparty确实需要,因为它提供了一个使用gmaps和osmdroid apis的包装器

如果您正在构建源代码:osmdroid可以使用maven(当前存在播放服务问题)和gradle构建。建议你使用gradle与android studio

否则使用此

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

答案 1 :(得分:0)

我不认为osmdroid确实需要googlemaps库。但无论如何,您是否尝试过将google-play-services库添加到build.gradle?

如果您还没有,可以按照以下步骤执行此操作

  • 点击“项目结构”
  • 转到“依赖关系选项卡”
  • 点击+按钮
  • 选择com.google.android.gms:play-services并单击“确定”
  • 重建项目
相关问题