Maven android 同时管理 android 2.2 和 3.0
有没有办法管理在 Android 2.2 和 >= 上运行的项目,并且使用 3.0 >= 平台的特定 Android 3.0 功能?
我尝试在 pom.xml 中设置
<sdk>
<platform>11</platform>
</sdk>
并在 manifest.xml 中
<uses-sdk android:minSdkVersion="8" />
设置这种配置在 Eclipse 中有效,因为我的路径中有 Android3.0.jar。但 Maven 则不然。未加载依赖项,因为编译错误与符号“Fragments”、“FragmentTransaction”等有关...未找到。
那么我该如何配置我的 pom 来考虑到这一点呢?
这是我的整个依赖项配置,非常感谢。
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>2.3.3</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android-test</artifactId>
<version>2.3.3</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.twitter4j</groupId>
<artifactId>twitter4j-core</artifactId>
<version>2.2.2</version>
</dependency>
<dependency>
<groupId>oauth.signpost</groupId>
<artifactId>signpost-commonshttp4</artifactId>
<version>1.2.1.1</version>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
</dependency>
</dependencies>
Is there a way to manage a project that runs on Android 2.2 and >= and that uses specific Android 3.0 functionalities for 3.0 >= plateforms ?
I tried to set in the pom.xml
<sdk>
<platform>11</platform>
</sdk>
And in the manifest.xml
<uses-sdk android:minSdkVersion="8" />
This kind of configuration works in Eclipse as I have the Android3.0.jar in the path. But it does not with Maven. Dependencies are not loaded since the compilation errors are about symbols "Fragments", "FragmentTransaction", etc... are not found.
So how could I configure my pom to take this into account ?
Here is my whole dependencies configuration, thanks a lot in advance.
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>2.3.3</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android-test</artifactId>
<version>2.3.3</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.twitter4j</groupId>
<artifactId>twitter4j-core</artifactId>
<version>2.2.2</version>
</dependency>
<dependency>
<groupId>oauth.signpost</groupId>
<artifactId>signpost-commonshttp4</artifactId>
<version>1.2.1.1</version>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
</dependency>
</dependencies>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在 maven-android-plugin 中打开了一个问题: 问题188..
首先要做的是使用最新版本的 mosabua 安装 Android本地 Maven 存储库中的库。
所有错误都是正确的,但我仍然遇到编译时未找到的 Activity#getFragmentManager() 方法的问题。
I opened an issue in the maven-android-plugin : issue 188.
The first thing to do is to use the last version of mosabua to install the Android library in the local maven repository.
All the errors were correct but I still have a problem with the Activity#getFragmentManager() method that is not found at the compilation.