我在我的项目中使用apache-mime4j-0.6.jar,httpmime-4.0.2.jar,commons-codec-1.8.jar和httpcore-4.2.2.jar。
在我的下面的代码行
HttpParams params = new SyncBasicHttpParams();
屏幕截图也已附上。
我收到错误(发布logcat)。
09-06 18:23:11.088: W/dalvikvm(19749): Superclass of 'Lorg/apache/http/params/SyncBasicHttpParams;' is final 'Lorg/apache/http/params/BasicHttpParams;'
09-06 18:23:11.088: W/dalvikvm(19749): Link of class 'Lorg/apache/http/params/SyncBasicHttpParams;' failed
09-06 18:23:11.639: E/dalvikvm(19749): Could not find class 'org.apache.http.params.SyncBasicHttpParams', referenced from method com.indapoint.twitter.Twitter.verifyCredentials
09-06 18:23:11.639: W/dalvikvm(19749): VFY: unable to resolve new-instance 973 (Lorg/apache/http/params/SyncBasicHttpParams;) in Lcom/indapoint/twitter/Twitter;
09-06 18:23:11.639: D/dalvikvm(19749): VFY: replacing opcode 0x22 at 0x0148
09-06 18:23:11.639: W/dalvikvm(19749): Superclass of 'Lorg/apache/http/params/SyncBasicHttpParams;' is final 'Lorg/apache/http/params/BasicHttpParams;'
09-06 18:23:11.639: W/dalvikvm(19749): Link of class 'Lorg/apache/http/params/SyncBasicHttpParams;' failed
09-06 18:23:12.259: D/dalvikvm(19749): DexOpt: unable to opt direct call 0x18dd at 0x1be in Lcom/indapoint/twitter/Twitter;.deleteStatus
09-06 18:23:12.259: W/dalvikvm(19749): Superclass of 'Lorg/apache/http/params/SyncBasicHttpParams;' is final 'Lorg/apache/http/params/BasicHttpParams;'
09-06 18:23:12.259: W/dalvikvm(19749): Link of class 'Lorg/apache/http/params/SyncBasicHttpParams;' failed
09-06 18:23:12.720: D/dalvikvm(19749): DexOpt: unable to opt direct call 0x18dd at 0x176 in Lcom/indapoint/twitter/Twitter;.getTwitterAccessTokenFromAuthorizationCode
09-06 18:23:12.720: W/dalvikvm(19749): Superclass of 'Lorg/apache/http/params/SyncBasicHttpParams;' is final 'Lorg/apache/http/params/BasicHttpParams;'
09-06 18:23:12.720: W/dalvikvm(19749): Link of class 'Lorg/apache/http/params/SyncBasicHttpParams;' failed
09-06 18:23:13.370: D/dalvikvm(19749): DexOpt: unable to opt direct call 0x18dd at 0x19e in Lcom/indapoint/twitter/Twitter;.searchTweets
09-06 18:23:13.370: W/dalvikvm(19749): Superclass of 'Lorg/apache/http/params/SyncBasicHttpParams;' is final 'Lorg/apache/http/params/BasicHttpParams;'
09-06 18:23:13.370: W/dalvikvm(19749): Link of class 'Lorg/apache/http/params/SyncBasicHttpParams;' failed
09-06 18:23:14.011: D/dalvikvm(19749): DexOpt: unable to opt direct call 0x18dd at 0x148 in Lcom/indapoint/twitter/Twitter;.startTwitterAuthentication
09-06 18:23:14.011: W/dalvikvm(19749): Superclass of 'Lorg/apache/http/params/SyncBasicHttpParams;' is final 'Lorg/apache/http/params/BasicHttpParams;'
09-06 18:23:14.011: W/dalvikvm(19749): Link of class 'Lorg/apache/http/params/SyncBasicHttpParams;' failed
09-06 18:23:14.622: D/dalvikvm(19749): DexOpt: unable to opt direct call 0x18dd at 0x19c in Lcom/indapoint/twitter/Twitter;.updateStatus
09-06 18:23:14.622: W/dalvikvm(19749): Superclass of 'Lorg/apache/http/params/SyncBasicHttpParams;' is final 'Lorg/apache/http/params/BasicHttpParams;'
09-06 18:23:14.622: W/dalvikvm(19749): Link of class 'Lorg/apache/http/params/SyncBasicHttpParams;' failed
09-06 18:23:15.132: D/dalvikvm(19749): DexOpt: unable to opt direct call 0x18dd at 0x190 in Lcom/indapoint/twitter/Twitter;.updateStatusWithMedia
09-06 18:23:15.142: W/dalvikvm(19749): Superclass of 'Lorg/apache/http/params/SyncBasicHttpParams;' is final 'Lorg/apache/http/params/BasicHttpParams;'
09-06 18:23:15.142: W/dalvikvm(19749): Link of class 'Lorg/apache/http/params/SyncBasicHttpParams;' failed
09-06 18:23:15.723: D/dalvikvm(19749): DexOpt: unable to opt direct call 0x18dd at 0x14a in Lcom/indapoint/twitter/Twitter;.verifyCredentials
09-06 18:23:18.336: I/System.out(19749): parameter_string=oauth_consumer_key=******&oauth_nonce=11bd01ceb3e640479e43f16f35383c44&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1378471998&oauth_version=1.0
09-06 18:23:18.356: I/System.out(19749): authorization_header_string=OAuth oauth_consumer_key="******",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1378471998",oauth_nonce="11bd01ceb3e640479e43f16f35383c44",oauth_version="1.0",oauth_signature="******"
09-06 18:23:23.711: D/AndroidRuntime(19749): Shutting down VM
09-06 18:23:23.711: W/dalvikvm(19749): threadid=1: thread exiting with uncaught exception (group=0x415c0700)
09-06 18:23:23.761: E/AndroidRuntime(19749): FATAL EXCEPTION: main
09-06 18:23:23.761: E/AndroidRuntime(19749): java.lang.IncompatibleClassChangeError: org.apache.http.params.SyncBasicHttpParams
09-06 18:23:23.761: E/AndroidRuntime(19749): at com.indapoint.twitter.Twitter.startTwitterAuthentication(MainActivity.java:222)
09-06 18:23:23.761: E/AndroidRuntime(19749): at com.indapoint.twitter.MainActivity.onCreate(MainActivity.java:77)
09-06 18:23:23.761: E/AndroidRuntime(19749): at android.app.Activity.performCreate(Activity.java:5133)
09-06 18:23:23.761: E/AndroidRuntime(19749): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
09-06 18:23:23.761: E/AndroidRuntime(19749): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175)
09-06 18:23:23.761: E/AndroidRuntime(19749): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
09-06 18:23:23.761: E/AndroidRuntime(19749): at android.app.ActivityThread.access$600(ActivityThread.java:141)
09-06 18:23:23.761: E/AndroidRuntime(19749): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
09-06 18:23:23.761: E/AndroidRuntime(19749): at android.os.Handler.dispatchMessage(Handler.java:99)
09-06 18:23:23.761: E/AndroidRuntime(19749): at android.os.Looper.loop(Looper.java:137)
09-06 18:23:23.761: E/AndroidRuntime(19749): at android.app.ActivityThread.main(ActivityThread.java:5103)
09-06 18:23:23.761: E/AndroidRuntime(19749): at java.lang.reflect.Method.invokeNative(Native Method)
09-06 18:23:23.761: E/AndroidRuntime(19749): at java.lang.reflect.Method.invoke(Method.java:525)
09-06 18:23:23.761: E/AndroidRuntime(19749): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
09-06 18:23:23.761: E/AndroidRuntime(19749): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
09-06 18:23:23.761: E/AndroidRuntime(19749): at dalvik.system.NativeStart.main(Native Method)
我添加了库并仍然出现上述错误。我用谷歌搜索,但没有找到任何适当的解决方案。