简体   繁体   English

Android支持库v7 + Maven + Eclipse:在工作区中找不到apklib依赖项

[英]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.0com.msplearning:android-support-v7-appcompat:jar:19.1.0

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用Android支持库v7在Android Maven项目中的ActionBar - ActionBar in Android Maven Project using Android Support Library v7 maven android插件与android支持库v7 - maven android plugin with android support library v7 使用Eclipse的v7 appcompat导致Android支持库出现问题 - Android Support Library troubles with v7 appcompat using Eclipse 如何将Android支持v7库加载到SBT Android项目中? - How to load Android support v7 library into SBT Android Project? 带有Android 2.3中的ActionBar和支持库v7的Android Force Close - Android Force Close with ActionBar and Support Library v7 in Android 2.3 为eclipse设置Android支持包v7 - GridLayout - Setting up Android support package v7 for eclipse - GridLayout 在Android中从Support Library v7实现样式 - Implementing styles from Support Library v7 in android 混淆Android库项目/ apklib - Obfuscating an Android Library project / apklib Robolectric 3.0-java.lang.NoClassDefFoundError:测试库模块时android / support / v7 / appcompat / R $ styleable - Robolectric 3.0 - java.lang.NoClassDefFoundError: android/support/v7/appcompat/R$styleable when testing library module 插入子视图时,Android支持v7网格布局崩溃 - Android support v7 gridlayout crashes when inserting child views
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM