我想要获得一个示例Android应用程序来运行。该应用程序使用Maven来管理项目。当我运行的项目,我收到以下错误:Maven和Android找不到类CommonsHttpOAuthConsumer
Could not find class 'oauth.signpost.commonshttp.CommonsHttpOAuthConsumer', referenced from method....
然而在pom.xml文件中我有
<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>1.6_r2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>oauth.signpost</groupId>
<artifactId>signpost-core</artifactId>
<version>1.2.1.1</version>
</dependency>
<dependency>
<groupId>oauth.signpost</groupId>
<artifactId>signpost-commonshttp4</artifactId>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20090211</version>
</dependency>
</dependencies>
鉴于依赖可以在编译时得到解决,因为它显然是在依赖列表,我需要做什么来解决运行时错误?
我使用Windows 7,JDK 1.6,Eclipse的靛蓝(使用Maven插件)
感谢, 杰克
我刚才注意到,使用M2E与在Eclipse中查看我的POM文件时“依赖关系”视图(不是原始的xml)。我看到:
android:1.6_r2:jar [provided]
signpost-core:1.2.1.1 [compile]
json:20090211:jar [compile]
signpost-commonshttp4
的字符串识别依赖似乎并不完整,不存在类型或版本号,它也不会显示范围。
我修改了依赖包括: 1.2.1.1 但是我仍然得到错误(我用http://search.maven.org查找版本号) –
Jack
那么什么是“当我运行项目“是什么意思?但是你正在运行,似乎oauth jar不在类路径中。 –
将apk部署到设备并启动时。在运行时,无法找到该类。 – Jack