Android的Maven项目在Eclipse中apklib [英] Android Maven Project in Eclipse with apklib

查看:257
本文介绍了Android的Maven项目在Eclipse中apklib的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想补充谷歌播放服务,以现有使用的jar和apklib Android的Maven项目。该项目不编译使用MVN全新安装,但在Eclipse中我得到这个错误:

I am trying to add google play services to existing android maven project using jar and apklib. The project does compile using mvn clean install, but in Eclipse i am getting this error:

错误:未发现的资源匹配给定名称(在价值,值为@整数/ google_play_services_version)。 AndroidManifest.xml中/ pruebas-束的Andr​​oid线51的Andr​​oid AAPT问题

Error: No resource found that matches the given name (at 'value' with value '@integer/google_play_services_version'). AndroidManifest.xml /pruebas-bundle-android line 51 Android AAPT Problem

我是新与Maven,所以我不知道这是什么原因。我已经寻找上的错误信息,但还没有找到任何可以让我解决这个问题。我使用maven 3.2.2和M2E 1.4。这是我的pom.xml

I am new with maven, so i don´t know what could cause this. I have searched for information on the error but have not found anything that could let me solve it. I am using maven 3.2.2 and m2e 1.4. This is my pom.xml

<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.pruebas.pruebas</groupId>
  <artifactId>pruebas-bundle-android</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>apk</packaging>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
  <dependencies>
    <dependency>
      <groupId>android</groupId>
      <artifactId>android</artifactId>
      <version>4.4.2_r3</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>android.support</groupId>
      <artifactId>compatibility-v4</artifactId>
      <version>20.0.0</version>
    </dependency>
    <dependency>
        <groupId>com.google.android.gms</groupId>
        <artifactId>google-play-services</artifactId>
        <version>19.0.0</version>
        <type>apklib</type>
    </dependency>
    <dependency>
        <groupId>com.google.android.gms</groupId>
        <artifactId>google-play-services</artifactId>
        <version>19.0.0</version>
        <type>jar</type>
    </dependency>
    <dependency>
      <groupId>urbanairship</groupId>
      <artifactId>urbanairship-lib</artifactId>
      <version>4.0.3</version>
    </dependency>
    <dependency>
      <groupId>com.crittercism</groupId>
      <artifactId>crittercism-android-agent</artifactId>
      <version>LATEST</version>
    </dependency>
  </dependencies>
  <repositories>
    <repository>
      <id>local-repository</id>
      <url>file:${basedir}/local-repository</url>
    </repository>
  </repositories>
  <build>
    <sourceDirectory>src</sourceDirectory>
    <plugins>
      <plugin>
        <groupId>com.jayway.maven.plugins.android.generation2</groupId>
        <artifactId>android-maven-plugin</artifactId>
        <version>3.9.0-rc.3</version>
        <extensions>true</extensions>
        <configuration>
          <sdk>
            <platform>19</platform>
          </sdk>
          <manifest>
            <debuggable>false</debuggable>
          </manifest>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>

这个问题似乎是由于apklib。在Eclipse中,我可以看到在Maven中依赖我所有的依赖罐子,但我不知道如何使现有的谷歌播放服务apklib在Eclipse中。我想AP preciate任何帮助这一点。

The problem seems to be due to the apklib. In Eclipse, i can see all my dependencies jar in Maven dependencies, but i don´t know how to make available the google play services apklib in Eclipse. I would appreciate any help with this.

推荐答案

为了编译一个Android库(APKLIB)的依赖在Eclipse中,你需要有 M2E-机器人安装和的Andr​​oid的库源$ C ​​$ C检出Mavenised复制到本地Eclipse工作区。

In order to compile a project with an Android Library (APKLIB) dependency in Eclipse you need to have m2e-android installed and a "Mavenised" copy of the Android Library source code checked-out into your local Eclipse workspace.

当我说Mavenised我的意思是在Android库项目应具有符合 apklib 相关性在坐标(组ID,版本等)POM你的应用程序POM。

When I say "Mavenised" I mean that the Android Library project should have a POM with coordinates (group ID, version, etc.) that match the apklib dependency in you application POM.

这篇关于Android的Maven项目在Eclipse中apklib的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆