【问题标题】:Android Maven Project in Eclipse with apklibEclipse 中带有 apklib 的 Android Maven 项目
【发布时间】:2014-10-10 05:25:42
【问题描述】:

我正在尝试使用 jar 和 apklib 将 google play 服务添加到现有的 android maven 项目中。该项目确实使用 mvn clean install 编译,但在 Eclipse 中我收到此错误:

错误:未找到与给定名称匹配的资源(在“值”处,值为“@integer/google_play_services_version”)。 AndroidManifest.xml /pruebas-bundle-android 第 51 行 Android AAPT 问题

我是 maven 的新手,所以我不知道是什么原因造成的。我已经搜索了有关该错误的信息,但没有找到任何可以让我解决它的信息。我正在使用 maven 3.2.2 和 m2e 1.4。这是我的 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 依赖项中看到我所有的依赖项 jar,但我不知道如何在 Eclipse 中提供 google play services apklib。我将不胜感激。

【问题讨论】:

    标签: android eclipse maven m2eclipse apklib


    【解决方案1】:

    要在 Eclipse 中编译具有 Android 库 (APKLIB) 依赖项的项目,您需要安装 m2e-android 并将 Android 库源代码的“Mavenised”副本签出到本地 Eclipse 工作区。

    当我说“Mavenised”时,我的意思是 Android 库项目应该有一个 POM,其坐标(组 ID、版本等)与您的应用程序 POM 中的 apklib 依赖项相匹配。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-09-18
      • 2013-02-06
      • 2012-12-30
      • 1970-01-01
      • 1970-01-01
      • 2012-12-02
      • 1970-01-01
      相关资源
      最近更新 更多