How to add google maps v2 sdk to maven project as dependency?

三世轮回 提交于 2019-12-12 03:44:37

问题


How to add google maps v2 sdk to maven project as dependency? I am using jar file but project need resource. How i can add them?


回答1:


You should be able to use my Maven Android SDK Deployer to get the the Play services install into your local Maven repository or deployed to your repository manager and then add a apklib dependency to the Google Play Services, which contains the maps stuff.

More at https://github.com/mosabua/maven-android-sdk-deployer




回答2:


It looks like the Maps v2 API is part of Google Play Services. So from the SDK manager, you need to make sure it's installed (under the 'Extras' category.) Then use the maven-android-sdk-deployer (as Manfred pointed out) to install the extras/google-play-services package. Then use this in your POM:

<dependency>
    <groupId>com.google.android.gms</groupId>
    <artifactId>google-play-services</artifactId>
    <version>7</version>
    <type>apklib</type>
</dependency>
<dependency>
    <groupId>com.google.android.gms</groupId>
    <artifactId>google-play-services</artifactId>
    <version>7</version>
    <type>jar</type>
</dependency>

I noticed this when the maps JAR I was using has the package name com.google.android.maps but the v2 API uses com.google.android.gms.maps



来源:https://stackoverflow.com/questions/15032154/how-to-add-google-maps-v2-sdk-to-maven-project-as-dependency

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!