找不到 Google API 使用地图的 Maven 依赖项

Cant find maven dependency for Google APIs to use maps(找不到 Google API 使用地图的 Maven 依赖项)
本文介绍了找不到 Google API 使用地图的 Maven 依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我正在尝试使用 maven 来管理我的依赖项和构建过程.我在查找 Google API 依赖项或地图依赖项时遇到问题.这很好用(没有地图 api):

I'm trying to use maven to manage my dependencies and build process. I have a problem to find the Google API dependency or the maps dependency. This works fine (without maps api):

<dependency>
    <groupId>com.google.android</groupId>
    <artifactId>android</artifactId>
    <version>4.0.1.2</version>
    <scope>provided</scope>
</dependency>

推荐答案

AFAIK,地图 jar 文件目前在任何在线 maven 存储库中都不可用.

AFAIK, map jar files are not available in any online maven repository at the moment.

使用 Android SDK Manager 下载所需的地图 jar 文件,然后手动将其安装到本地 maven 存储库:

Either use Android SDK Manager download the required map jar file then manually install it to you local maven repository:

mvn install:install-file -Dfile=your-artifact-1.0.jar 
    [-DgroupId=org.some.group] 
    [-DartifactId=your-artifact] 
    [-Dversion=1.0] 
    [-Dpackaging=jar]

或者使用 Manfred 的 maven-android-sdk-deployer 将所有 Android SDK jar 文件安装到本地Maven 仓库.

Or use Manfred's maven-android-sdk-deployer install all Android SDK jar files to your local maven repository.

然后就可以在 pom.xml 中开始使用了:

Then you can start using it in pom.xml:

<dependency>
    <groupId>com.google.android.maps</groupId>
    <artifactId>maps</artifactId>
    <version>4_r2</version>
    <scope>provided</scope>
</dependency>

这篇关于找不到 Google API 使用地图的 Maven 依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

How can I use CClistview in COCOS2d Android?(如何在 COCOS2d Android 中使用 CClistview?)
cocos2d-android: how to display score(cocos2d-android:如何显示分数)
Sqlite database not copied from asset folder Android(Sqlite 数据库未从资产文件夹 Android 复制)
SQLite Database Copy Appears Corrupted When Generated by Device and not Emulator(SQLite 数据库副本在由设备而不是模拟器生成时出现损坏)
Android file copy(安卓文件拷贝)
Android how to detect Copy event of Edittext in android(Android如何在android中检测Edittext的Copy事件)