行家Android插件与Android支持库V7 [英] maven android plugin with android support library v7
问题描述
我用maven-的Android插件来建立我的Android应用程序取决于Android的支持库V4和V7。
因为我没有找到如何从developer.android.com下载整个SDK,我cnnot用maven的Android deployee工具设置的android sdk.Thus我想使用包含在ADT-包的支持库的本地存储库,下面是我写在我的pom.xml依赖:
<依赖>
<的groupId> android.support< /的groupId>
< artifactId的>兼容性-V7< / artifactId的>
<版> 18 LT; /版本>
<范围>系统< /范围>
<systemPath>${project.basedir}/appcompat/libs/android-support-v7-appcompat.jar</systemPath>
&LT; /依赖性&GT;
&LT;依赖&GT;
&LT;的groupId&GT; android.support&LT; /的groupId&GT;
&LT; artifactId的&GT;兼容性-V4&LT; / artifactId的&GT;
&LT;版&GT; 18 LT; /版本&GT;
&LT;范围&GT;系统&LT; /范围&GT;
&LT; Systempath下&GT; $ {project.basedir} /appcompat/libs/android-support-v4.jar</systemPath>
&LT; /依赖性&GT;
&LT;依赖&GT;
&LT;的groupId&GT; android.support&LT; /的groupId&GT;
&LT; artifactId的&GT;兼容性&LT; / artifactId的&GT;
&LT;版&GT; 18 LT; /版本&GT;
&LT;范围&GT;系统&LT; /范围&GT;
&LT; Systempath下&GT; $ {project.basedir} /appcompat.apklib</systemPath>
&LT;类型&GT; apklib&LT; /类型&GT;
&LT; /依赖性&GT;
&LT;依赖&GT;
&LT;的groupId&GT; android.support&LT; /的groupId&GT;
&LT; artifactId的&GT;兼容性&LT; / artifactId的&GT;
&LT;版&GT; 18 LT; /版本&GT;
&LT;范围&GT;系统&LT; /范围&GT;
&LT; Systempath下&GT; $ {project.basedir} /appcompat/bin/appcompat.jar</systemPath>
&LT; /依赖性&GT;
前两个是我写的,在开始,但行家提出了一个错误:
未发现的资源匹配给定名称Theme.AppCompat.Light。
然后我说第三个。我压缩了V7项目,并改名为.apklib.But它仍然无法正常工作。
最后,我想补充的最后一个,但它不工作either.So如何写一个正确的POM解决这一问题?
我的系统信息来源:
的Apache Maven的3.0.4
Java版本:1.7.0_25,供应商:甲骨文公司
Android平台的版本:4.3
Android的Maven插件:3.6.0
当我在玩这个,我添加了一个&LT;类型&GT;罐子&LT; /类型&GT;
和&LT;类型&GT; apklib&LT; /类型&GT;
。我不记得所有的细节。
- 在我这样做:<一href="http://stackoverflow.com/a/18796764/1738827">http://stackoverflow.com/a/18796764/1738827
-
我的POM文件有这样的:
&LT;依赖&GT; &LT;的groupId&GT; com.android.support&LT; /的groupId&GT; &LT; artifactId的&GT; appcompat-V7&LT; / artifactId的&GT; &LT;版&GT; 18.0.0&LT; /版本&GT; &LT;类型&GT; apklib&LT; /类型&GT; &LT;范围&GT;编译&LT; /范围&GT; &LT; /依赖性&GT; &LT;依赖&GT; &LT;的groupId&GT; com.android.support&LT; /的groupId&GT; &LT; artifactId的&GT; appcompat-V7&LT; / artifactId的&GT; &LT;版&GT; 18.0.0&LT; /版本&GT; &LT;类型&GT;罐子&LT; /类型&GT; &LT;范围&GT;编译&LT; /范围&GT; &LT; /依赖性&GT;
I use maven-android-plugin to build my android app which depends on android support library v4 and v7.
Since I didn't find how to download the whole sdk from developer.android.com, I cnnot use maven android deployee tool to set local repository of android sdk.Thus I want to use the support library that includes in the adt-bundle, below is how I write the dependencies in my pom.xml:
<dependency>
<groupId>android.support</groupId>
<artifactId>compatibility-v7</artifactId>
<version>18</version>
<scope>system</scope>
<systemPath>${project.basedir}/appcompat/libs/android-support-v7-appcompat.jar</systemPath>
</dependency>
<dependency>
<groupId>android.support</groupId>
<artifactId>compatibility-v4</artifactId>
<version>18</version>
<scope>system</scope>
<systemPath>${project.basedir}/appcompat/libs/android-support-v4.jar</systemPath>
</dependency>
<dependency>
<groupId>android.support</groupId>
<artifactId>compatibility</artifactId>
<version>18</version>
<scope>system</scope>
<systemPath>${project.basedir}/appcompat.apklib</systemPath>
<type>apklib</type>
</dependency>
<dependency>
<groupId>android.support</groupId>
<artifactId>compatibility</artifactId>
<version>18</version>
<scope>system</scope>
<systemPath>${project.basedir}/appcompat/bin/appcompat.jar</systemPath>
</dependency>
The first two is what I wrote at beginning, but maven raised an error:
No resource found that matches the given name 'Theme.AppCompat.Light'.
Then I added third one. I zip the v7 project and rename to .apklib.But it still does not work.
At last I add the last one,but it does not work either.So how to write a correct pom to fix this?
My system infomation:
Apache Maven 3.0.4
Java version: 1.7.0_25, vendor: Oracle Corporation
Android Platform Version:4.3
Android Maven Plugin:3.6.0
When I was playing with this I added a <type>jar</type>
and a <type>apklib</type>
. I don't remember all the details.
- I did this: http://stackoverflow.com/a/18796764/1738827
My pom file had this:
<dependency> <groupId>com.android.support</groupId> <artifactId>appcompat-v7</artifactId> <version>18.0.0</version> <type>apklib</type> <scope>compile</scope> </dependency> <dependency> <groupId>com.android.support</groupId> <artifactId>appcompat-v7</artifactId> <version>18.0.0</version> <type>jar</type> <scope>compile</scope> </dependency>
这篇关于行家Android插件与Android支持库V7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!