生成兼容性-V7-appcompat的APKLIB [英] Generate APKLIB of compatibility-v7-appcompat

查看:196
本文介绍了生成兼容性-V7-appcompat的APKLIB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要开始使用新的动作条 appcompat-V7 支持库,而我使用行家的。我试图创建一个apklib。这是我遵循的步骤:

  1. 创建项目的ZIP文件 Android的软件开发工具包/演员/安卓/支持/ V7 / appcompat
  2. 在重命名与APKLIB扩展名的ZIP文件。
  3. 安装APKLIB文件到我的本地库:
  

C:.... M2 \库\机器人\ SUPPORT \兼容性-V7-appcompat \ 18> MVN   安装:安装文件-Dfile = appcombat.apklib -DgroupId = android.support   -DartifactId = appcompat -Dversion = 18 -Dpackaging = apklib

开始使用该库从我的Andr​​oid项目的POM添加这种依赖关系:

 <依赖>
        <的groupId> android.support< /的groupId>
        < artifactId的> appcompat< / artifactId的>
        <版> 18 LT; /版本>
        <类型> apklib< /类型>
    < /依赖性>
 

但它不工作。我越来越缺少神器的错误。
任何帮助将是非常美联社preciated。

解决方案

该是一种appcompat安装到你的本地库不依赖于Maven的SDK部署...

从Android SDK管理器,安装Android的支持库选项。 进入您的SDK文件夹,然后进入./extras/m2Repository/com/android/support/appcompat-v7/18.0.0

打开appcompat-v7-18.0.0.aar文件,并复制classes.jar到一个文件名为appcompat-v7-18.0.0.jar

在命令行进入同一m2Repository文件夹,然后运行下面的命令:

  MVN安装:安装文件-Dfile =./ COM /安卓/支持/ appcompat-V7 / 18.0.0 / appcompat-v7-18.0.0.jar/  ​​- DpomFile =./ COM /安卓/支持/ appcompat-V7 / 18.0.0 / appcompat-v7-18.0.0.pom/ -Dpackaging =罐子
MVN安装:安装文件-Dfile =./ COM /安卓/支持/ appcompat-V7 / 18.0.0 / appcompat-v7-18.0.0.aar/ -DpomFile =./ COM /安卓/支持/ appcompat -V7 / 18.0.0 / appcompat-v7-18.0.0.pom/ -Dpackaging =apklib
 

然后在你项目的POM添加以下两个依赖

 <依赖>
        <的groupId> com.android.support< /的groupId>
        < artifactId的> appcompat-V7< / artifactId的>
        <版> 18.0.0< /版本>
        <类型> apklib< /类型>
    < /依赖性>
    <依赖>
        <的groupId> com.android.support< /的groupId>
        < artifactId的> appcompat-V7< / artifactId的>
        <版> 18.0.0< /版本>
        <类型>罐子< /类型>
    < /依赖性>
 

I want to start using the new ActionBar of the appcompat-v7 support library, and I'm using maven. I tried to create an apklib. These are the steps I followed:

  1. Create a ZIP file of the project android-sdks/extras/android/support/v7/appcompat
  2. Rename the ZIP file with an APKLIB extension.
  3. Install the APKLIB file into my local repository:

C:....m2\repository\android\support\compatibility-v7-appcompat\18>mvn install:install-file -Dfile=appcombat.apklib -DgroupId=android.support -DartifactId=appcompat -Dversion=18 -Dpackaging=apklib

Start using the library from my android project adding this dependency in the pom:

    <dependency>
        <groupId>android.support</groupId>
        <artifactId>appcompat</artifactId>
        <version>18</version>
        <type>apklib</type>
    </dependency>

But it's not working. I'm getting an error of missing artifact.
Any help would be much appreciated.

解决方案

The is a way to install appcompat into your local repository without relying on Maven SDK deployer...

From the Android SDK Manager, install the 'Android Support Repository' option. go into your SDK folder, then into ./extras/m2Repository/com/android/support/appcompat-v7/18.0.0

open the appcompat-v7-18.0.0.aar file and copy the classes.jar out to a file named appcompat-v7-18.0.0.jar

at the command line go into the same m2Repository folder and run the following commands:

mvn install:install-file -Dfile="./com/android/support/appcompat-v7/18.0.0/appcompat-v7-18.0.0.jar"/ -DpomFile="./com/android/support/appcompat-v7/18.0.0/appcompat-v7-18.0.0.pom"/ -Dpackaging="jar"
mvn install:install-file -Dfile="./com/android/support/appcompat-v7/18.0.0/appcompat-v7-18.0.0.aar"/ -DpomFile="./com/android/support/appcompat-v7/18.0.0/appcompat-v7-18.0.0.pom"/ -Dpackaging="apklib"

Then add the following two dependencies in your project's POM

    <dependency>
        <groupId>com.android.support</groupId>
        <artifactId>appcompat-v7</artifactId>
        <version>18.0.0</version>
        <type>apklib</type>
    </dependency>
    <dependency>
        <groupId>com.android.support</groupId>
        <artifactId>appcompat-v7</artifactId>
        <version>18.0.0</version>
        <type>jar</type>
    </dependency>

这篇关于生成兼容性-V7-appcompat的APKLIB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆