JWebServices with Android doesn't work

左心房为你撑大大i 提交于 2020-01-04 08:33:52

问题


Code:

import com.independentsoft.exchange.Service;

import android.app.Activity;
import android.os.Bundle;

public class ContactsToExchangeActivity extends Activity {
        @Override
        public void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                setContentView(R.layout.main);

                Service service = new Service();
        }
}

Log:

 03-25 16:57:49.901: E/AndroidRuntime(717): FATAL EXCEPTION: main
 03-25 16:57:49.901: E/AndroidRuntime(717): java.lang.NoSuchMethodError: org.apache.http.conn.ssl.SSLSocketFactory.<init>
 03-25 16:57:49.901: E/AndroidRuntime(717): at com.independentsoft.exchange.Service.a(SourceFile:182)
 03-25 16:57:49.901: E/AndroidRuntime(717): at com.independentsoft.exchange.Service.<init>(SourceFile:90)
 03-25 16:57:49.901: E/AndroidRuntime(717): at ua.kh.softcompany.ContactsToExchangeActivity.onCreate(ContactsToExchangeActivity .java:22)
 03-25 16:57:49.901: E/AndroidRuntime(717): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
 03-25 16:57:49.901: E/AndroidRuntime(717): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
 03-25 16:57:49.901: E/AndroidRuntime(717): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
 03-25 16:57:49.901: E/AndroidRuntime(717): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
 03-25 16:57:49.901: E/AndroidRuntime(717): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
 03-25 16:57:49.901: E/AndroidRuntime(717): at android.os.Handler.dispatchMessage(Handler.java:99)
 03-25 16:57:49.901: E/AndroidRuntime(717): at android.os.Looper.loop(Looper.java:130)
 03-25 16:57:49.901: E/AndroidRuntime(717): at android.app.ActivityThread.main(ActivityThread.java:3683)
 03-25 16:57:49.901: E/AndroidRuntime(717): at java.lang.reflect.Method.invokeNative(Native Method)
 03-25 16:57:49.901: E/AndroidRuntime(717): at java.lang.reflect.Method.invoke(Method.java:507)
 03-25 16:57:49.901: E/AndroidRuntime(717): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
 03-25 16:57:49.901: E/AndroidRuntime(717): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
 03-25 16:57:49.901: E/AndroidRuntime(717): at dalvik.system.NativeStart.main(Native Method)

Can you please tell what the problem is and how to fix it?


回答1:


Had similar problem and asked Independentsoft to send me Android specific jar file. They have separate build for Andorid.



来源:https://stackoverflow.com/questions/9862635/jwebservices-with-android-doesnt-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!