gpt4 book ai didi

android - 如何将 apklib 依赖项添加到您的 android maven 项目?

转载 作者:行者123 更新时间:2023-11-29 16:09:47 25 4
gpt4 key购买 nike

我有一个 android 项目,我正在使用 eclipse 开发并使用 maven 进行构建。我想在其中包含一个 lib (apklib),并且与其他包含类似,我尝试通过以下方式将依赖项附加到我的 pom:

<dependency>
<groupId>groupID.name</groupId>
<artifactId>artifact.name</artifactId>
<version>version</version>
</dependency>

但是,当尝试从 m2eclipse 或控制台上的 maven 构建它时,我会收到错误

(Failed to execute goal on project projectName: Could not resolve dependencies for project project Failure to find apklib in repo was cached in the local repository, resolution will not be reattempted until the update interval of repo has elapsed or updates are forced)

说即使我能在我的.m2目录中看到这个依赖也找不到这个依赖

最佳答案

解决方案非常简单,但由于我是通过一个试图演示其他内容的示例而不是问答找到它的(并且我在 maven-android-plugin 项目中不容易找到它,)我决定分享它在这里希望它可以帮助某人。

解决方案就是将我的依赖类型设置为 apklib 这样:

<dependency>
<groupId>groupID.name</groupId>
<artifactId>artifact.name</artifactId>
<version>version</version>
<type>apklib</type>
</dependency>

关于android - 如何将 apklib 依赖项添加到您的 android maven 项目?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14354907/

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