[英]Android Support Library v7 + Maven + Eclipse: apklib dependency not found in workspace
I'm trying to configure the library v7 support in my project so that it uses ActionBarActivity, thus keeping compliant with some of the Android 2.X versions. 我正在尝试在我的项目中配置库v7支持,以便它使用ActionBarActivity,从而保持与某些Android 2.X版本的兼容性。
First, follow the documentation from Google and imported the project android-support-v7-appcompat
as a library in accordance with Section Adding libraries with resources on Support Library Setup . 首先,按照Google提供的文档,将项目android-support-v7-appcompat
为库,按照章节添加库和 支持库设置中的 资源 。 But this way my Maven Build failed because it could not find the dependence of the library in question. 但是这样我的Maven Build失败了,因为它找不到相关库的依赖性。
Now, I decided to seek a cleaner solution, keeping my dependences managed by Maven . 现在,我决定寻求一个更清洁的解决方案,让我的依赖由Maven管理 。 To do this follow the instructions of the answer , but using version 19.0.1. 为此,请按照答案的说明进行操作,但使用的是版本19.0.1。 This made my Maven Build it were executed successfully, but my project is not compiling in my workspace, the following error occurs on first line of my POM: 这使我的Maven Build成功执行,但我的项目没有在我的工作区编译 ,在我的POM的第一行发生以下错误:
dependency=[com.android.support:appcompat-v7:apklib:19.0.1:compile]not found in workspace
My dependencies are as follows: 我的依赖关系如下:
<dependency>
<groupId>com.android.support</groupId>
<artifactId>appcompat-v7</artifactId>
<version>${com.android.support-version}</version>
<type>apklib</type>
</dependency>
<dependency>
<groupId>com.android.support</groupId>
<artifactId>appcompat-v7</artifactId>
<version>${com.android.support-version}</version>
<type>jar</type>
</dependency>
The project in question is on GitHub, if they want to view it: https://github.com/veniltonjr/msplearning 有问题的项目在GitHub上,如果他们想查看它: https : //github.com/veniltonjr/msplearning
Thank you in advance! 先感谢您!
First, there is no apklib for com.android.support:appcompat-v7. 首先,com.android.support:appcompat-v7没有apklib。 It only ships as an aar. 它只是作为aar发货。
Second, that library is not available in maven-central, it ships with the Android SDK. 其次,该库在maven-central中不可用,它附带Android SDK。 You need to manually deploy it to your local maven repository. 您需要手动将其部署到本地maven存储库。
Though you can use maven-sdk-deployer to construct and deploy the apk to your local folder. 虽然您可以使用maven-sdk-deployer构建apk并将其部署到本地文件夹。 But you github project is failing due to missing internal dependencies. 但是由于缺少内部依赖性,你的github项目失败了。 com.msplearning.android-support-v4:jar:19.1.0
, com.msplearning:android-support-v7-appcompat:jar:19.1.0
com.msplearning.android-support-v4:jar:19.1.0
, com.msplearning:android-support-v7-appcompat:jar:19.1.0
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.