【发布时间】:2015-04-14 02:12:43
【问题描述】:
我在使用 Eclipse 开发的 Android 应用程序中使用 FFmpegMediaMetadataRetriever(以下简称 FMMR)。我正在尝试将其转换为 Maven 项目,这是导致问题的最后一个依赖项。
Maven 正确下载了 FMMR,但它没有链接到 Eclipse 中的“Maven 依赖项”,并且将其导入到一个类中会出现错误“无法解析导入 wseemann”。其他依赖项正常工作。
FMMR 作为 APK 分发;其他的是 JAR。
完整的 POM 是:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.pconley</groupId>
<version>0.0.1-SNAPSHOT</version>
<packaging>apk</packaging>
<artifactId>TestApp</artifactId>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>4.1.1.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.github.wseemann</groupId>
<artifactId>FFmpegMediaMetadataRetriever</artifactId>
<version>1.0.0</version>
<scope>runtime</scope>
<type>apk</type>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<sourceDirectory>src</sourceDirectory>
<pluginManagement>
<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>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<configuration>
<sdk>
<platform>21</platform>
</sdk>
<testCoverageFile>/data/data/com.github.pconley.TestApp/cache/test-coverage.ec</testCoverageFile>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
一些注意事项:
- 完整的最小示例项目是on Github。
- 我正在使用 m2e 和 m2e-android。
- 我将其导入 Android Studio 并在 gradle 中添加了依赖项:同样的问题。
- 我尝试使用我下载的 jar 作为系统范围的依赖项:这解决了导入错误,但在编译的项目中不包含 FMMR。
是我做错了什么,还是 FMMR APK 构建不正确?
【问题讨论】: