【问题标题】:OSMDroid in Android StudioAndroid Studio 中的 OSMDroid
【发布时间】:2015-10-17 20:06:49
【问题描述】:

我已经通过 POM.xml 文件在 Android Studio 中导入了 OSMDroid 完整项目。已导入但出现以下错误

2:00:03 AM Error when importing module 'Google wrapper sample application': Cannot find file C:\Users\DevilsDream\.m2\repository\com\google\android\gms\google-play-services\27.0.0\google-play-services-27.0.0.pom
2:00:12 AM Error when importing module '~apklib-com.google.android.gms_google-play-services_27.0.0': Cannot find file C:\Users\DevilsDream\.m2\repository\com\google\android\gms\google-play-services\27.0.0\google-play-services-27.0.0.apklib
2:00:12 AM Error when importing module '~apklib-com.google.android.gms_google-play-services_27.0.0': Cannot find sdk info for artifact com.google.android.gms:google-play-services:27.0.0
2:00:12 AM Error when importing module '~apklib-com.google.android.gms_google-play-services_27.0.0': Cannot find resolved info for artifact com.google.android.gms:google-play-services:27.0.0

如何在 Android Studio 中使用 OSMDroid

【问题讨论】:

    标签: android maven android-studio osmdroid


    【解决方案1】:

    osmdroid 使用 maven 构建系统(暂时)。 maven android 插件无法使用 android studio 正确导入。你可能有更好的 intellj 运气。您不需要将项目导入 android studio。你真的只需要在你的项目中包含 osmdroid 的依赖。

    Osmdroid 确实有用于示例应用程序的 gradle 构建文件以简化开发。

    https://github.com/osmdroid/osmdroid/wiki/How-to-add-the-osmdroid-library-via-Gradle

    dependencies {
        compile 'org.osmdroid:osmdroid-android:4.4'
        compile 'org.slf4j:slf4j-simple:1.6.1'
    }
    

    您还需要在此处查阅有关如何使用 Osmdroid 的 wiki:https://github.com/osmdroid/osmdroid/wiki/How-to-use-the-osmdroid-library

    【讨论】:

    【解决方案2】:

    我正在使用 osmdroid v.4.2:

    dependencies {
    compile 'org.osmdroid:osmdroid-android:4.2'
    compile 'org.slf4j:slf4j-simple:1.6.1'
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多