使用jReddit时没有这样的字段错误

时间:2015-01-29 18:37:37

标签: java android-studio jreddit

尝试运行使用jReddit library的应用时,会抛出No Such Field Error: java.lang.NoSuchFieldError: org.apache.http.message.BasicLineFormatter.INSTANCE

看看其他SO问题,似乎重命名http-core库会解决这个问题,但由于我在java上相对较新,并且不想编辑jreddit jar因为害怕它破坏,我无法关注给出的建议。

1 个答案:

答案 0 :(得分:2)

免责声明:我是jreddit项目的当前维护者

您可以尝试在项目中添加这些依赖项吗?

dependencies {
    compile('com.github.jreddit:jreddit:1.0.3') {
        exclude group: 'org.apache.httpcomponents', module: 'httpclient'
        exclude module: 'junit'
    }
    compile 'org.apache.httpcomponents:httpclient-android:4.3.5.1'
    compile 'com.android.support:appcompat-v7:22.0.0'
}

另外,您还要检查我已回答here

的其他问题