simpligility / ksoap2-android

ksoap2-android - SOAP support for Android
http://simpligility.github.io/ksoap2-android/
Other
543 stars 247 forks source link

okhttp 3.6.0 Error #108

Closed dco5 closed 5 years ago

dco5 commented 7 years ago

Hello I am getting an error when using okhttp 3.6.0, but when I change to okhttp 3.2.0 the error goes away. Is there a way to use the newer verstion of okhttp or just have to wait for support of 3.6.0 gets release?

Caused by: java.lang.VerifyError: okhttp3/internal/huc/HttpURLConnectionImpl at org.ksoap2.transport.OkHttpServiceConnectionSE.<init>(OkHttpServiceConnectionSE.java:63) at org.ksoap2.transport.OkHttpServiceConnectionSE.<init>(OkHttpServiceConnectionSE.java:54) at org.ksoap2.transport.OkHttpTransportSE.getServiceConnection(OkHttpTransportSE.java:54) at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:154) at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:118) at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:113) at com.tecsiq.warrantiq.network.SoapSettings.makeSoapCall(SoapSettings.java:84) at com.tecsiq.warrantiq.ui.activities.LoginActivity$performLoginRequestAsyncTask.doInBackground(LoginActivity.java:242) at com.tecsiq.warrantiq.ui.activities.LoginActivity$performLoginRequestAsyncTask.doInBackground(LoginActivity.java:178) at android.os.AsyncTask$2.call(AsyncTask.java:287) at java.util.concurrent.FutureTask.run(FutureTask.java:234) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)  at java.lang.Thread.run(Thread.java:841) 

mosabua commented 7 years ago

Sorry... are you saying it works with 3.6.0 ? We could upgrade the dependency and release a new version if thats the case..

dco5 commented 7 years ago

Sorry I sound confusing. It does not work with okhttp 3.6.0.

mosabua commented 7 years ago

So ksoap android uses okhttp 3.2.0 so I am not sure what you want me to do about this problem then? Just warn me not to upgrade? The verify error is due to a different language level of 3.6.0. I have not looked but maybe it uses Java 8, whereas 3.2.0 is Java 7. And that might be a problem with your build or your app?

dco5 commented 7 years ago

So I tried different versions of okhttp and ksoap2 works with okhttp version 3.3.1, it stops working with version 3.4.0. I think you are right, maybe they started using Java 8 after in version 3.4.0. I am using another package that uses okhttp 3.6.0, so that is where the problem started. I will exclude the other package dependency on okhttp 3.6.0 and use okhttp 3.2.0, so that should solve the problem. Thank you for your help!

Kisty commented 7 years ago

I wonder what would happen if you excluded the okhttp-urlconnection dependency from ksoap2-android but kept okhttp3 3.6.0 as an app dependency. I think it's a transitive dependency conflict. Had similar issues with SimpleXML having to exclude some modules.

    compile 'com.google.code.ksoap2-android:ksoap2-android:3.6.2' {
        exclude group: 'com.squareup.okhttp3', module: 'okhttp-urlconnection'
    }

Perhaps, @mosabua it might require a new release with an updated okhttp3 to remove the need for the workaround?

mosabua commented 7 years ago

I can cut a new release easily but what version of okhttp3 should I use?

Kisty commented 7 years ago

Perhaps the latest version if possible or the most recent that's compatible witht the lib?

AMarguier commented 6 years ago

hi guys, i recently moved an android project from eclipse to android studio, and uped to api 21 I have to use from now the latest release of retrofit2 /converter. But, as I am using Ksoap to interact with my own server, I had a conflict (when merging ksoap with retrofit 2 )

I had to do this in my gradle script :

dependencies {
    api fileTree(dir: 'libs', include: ['*.jar'])   // there is the ksoap assembly with dep jar in the libs folder
    api ('com.squareup.retrofit2:converter-gson:2.3.0')
            {
                exclude module: 'okhttp' // excluded because of ksoap using okhttp 3.2.0 i guess
            }
}

Doing that way, i can use both libraries in my application, but, i noticed some side effects (maybe from android Api 21) where ksoap is leaking connection with my apache server. Some time, the device send a request to apache, apache responds correctly, but device doesn't receive it and resend the request, this for 4 to 5 times, before dying the connection. Then after i do the same (exactly the same) operation, and all works fine. I'm not sure of the origin of this problem, (i'm still tracking it in my project)

Anyway, is there a way to have a new version of Ksoap using current version of okhttp ?, or that i can dynamically build with it ?

mosabua commented 5 years ago

ready to cut 3.6.4 with new okhttp .. you wanna test?

mosabua commented 5 years ago

3.6.4 is released. Should fix the issue