gpt4 book ai didi

android - 使用 Maven 的 Android 项目中的 APK 依赖项中的“未解析类型”

转载 作者:行者123 更新时间:2023-11-30 02:14:17 24 4
gpt4 key购买 nike

我使用 FFmpegMediaMetadataRetriever (以下简称 FMMR)在我在 Eclipse 中开发的 Android 应用程序中。我正在尝试将其转换为 Maven 项目,这是导致问题的最后一个依赖项。

Maven 正确下载 FMMR,但它没有链接到 Eclipse 中的“Maven Dependencies”,将它导入到一个类中会出现错误“导入 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 以某种方式构建不正确?

最佳答案

我今天早上解决了打包问题,只需将以下行添加到您的模块 build.gradle 文件中:

编译'com.github.wseemann:FFmpegMediaMetadataRetriever:1.0.5

关于android - 使用 Maven 的 Android 项目中的 APK 依赖项中的“未解析类型”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29618076/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com