Skip to content
This repository has been archived by the owner on Jun 11, 2021. It is now read-only.

PayPal SDK doesn't work with the latest version of okhttp3 #258

Closed
jbaginski opened this issue Feb 11, 2016 · 20 comments
Closed

PayPal SDK doesn't work with the latest version of okhttp3 #258

jbaginski opened this issue Feb 11, 2016 · 20 comments

Comments

@jbaginski
Copy link

after upgrading okhttp3 from v3.0.1 to v3.1.2 we started to get this crash:

java.lang.RuntimeException: Unable to start service com.paypal.android.sdk.payments.PayPalService@fe7de67 with Intent { cmp=***/com.paypal.android.sdk.payments.PayPalService (has extras) }: java.lang.IllegalStateException: Unable to extract the trust manager on okhttp3.internal.Platform$Android@689f226, sslSocketFactory is class com.paypal.android.sdk.bn
    at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3027)
    at android.app.ActivityThread.-wrap17(ActivityThread.java)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1442)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:148)
    at android.app.ActivityThread.main(ActivityThread.java:5417)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
 Caused by: java.lang.IllegalStateException: Unable to extract the trust manager on okhttp3.internal.Platform$Android@689f226, sslSocketFactory is class com.paypal.android.sdk.bn
    at okhttp3.OkHttpClient.<init>(SourceFile:187)
    at okhttp3.OkHttpClient.<init>(SourceFile:60)
    at okhttp3.OkHttpClient$Builder.build(SourceFile:718)
    at com.paypal.android.sdk.bt.<init>(Unknown Source)
    at com.paypal.android.sdk.payments.PayPalService.a(Unknown Source)
    at com.paypal.android.sdk.payments.PayPalService.onStartCommand(Unknown Source)
    at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3010)
    at android.app.ActivityThread.-wrap17(ActivityThread.java) 
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1442) 
    at android.os.Handler.dispatchMessage(Handler.java:102) 
    at android.os.Looper.loop(Looper.java:148) 
    at android.app.ActivityThread.main(ActivityThread.java:5417) 
    at java.lang.reflect.Method.invoke(Native Method) 
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 

it could be related to square/okhttp#2323

@braebot
Copy link
Contributor

braebot commented Feb 11, 2016

Yeah, it's definitely related. Let's watch square/okhttp#2323 for progress on this issue.

@ghost
Copy link

ghost commented Feb 12, 2016

Hi, I have the same crash as @jbaginski. After updating to okhttp3 v3.1.2 and Paypal 2.13.1

@lovetomorrow
Copy link

same issue

@kroid333
Copy link

E/AndroidRuntime: java.lang.RuntimeException: Unable to start service com.paypal.android.sdk.payments.PayPalService@426c5830 with Intent { cmp=com.flyonthego/com.paypal.android.sdk.payments.PayPalService (has extras) }: java.lang.IllegalStateException: Unable to extract the trust manager on okhttp3.internal.Platform$Android@439bfaf8, sslSocketFactory is class com.paypal.android.sdk.ck
     at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3000)
     at android.app.ActivityThread.access$2200(ActivityThread.java:172)
     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
     at android.os.Handler.dispatchMessage(Handler.java:102)
     at android.os.Looper.loop(Looper.java:146)
     at android.app.ActivityThread.main(ActivityThread.java:5653)
     at java.lang.reflect.Method.invokeNative(Native Method)
     at java.lang.reflect.Method.invoke(Method.java:515)
     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
     at dalvik.system.NativeStart.main(Native Method)

E/AndroidRuntime:  Caused by: java.lang.IllegalStateException: Unable to extract the trust manager on okhttp3.internal.Platform$Android@439bfaf8, sslSocketFactory is class com.paypal.android.sdk.ck
at okhttp3.OkHttpClient.<init>(OkHttpClient.java:187)
     at okhttp3.OkHttpClient.<init>(OkHttpClient.java:60)
     at okhttp3.OkHttpClient$Builder.build(OkHttpClient.java:718)
     at com.paypal.android.sdk.cq.<init>(Unknown Source)
     at com.paypal.android.sdk.payments.PayPalService.a(Unknown Source)
     at com.paypal.android.sdk.payments.PayPalService.onStartCommand(Unknown Source)
     at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2983)
     at android.app.ActivityThread.access$2200(ActivityThread.java:172) 
     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405) 
     at android.os.Handler.dispatchMessage(Handler.java:102) 
     at android.os.Looper.loop(Looper.java:146) 
     at android.app.ActivityThread.main(ActivityThread.java:5653) 
     at java.lang.reflect.Method.invokeNative(Native Method) 
     at java.lang.reflect.Method.invoke(Method.java:515) 
     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291) 
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107) 
     at dalvik.system.NativeStart.main(Native Method) 

crash after start service:

Intent intent = new Intent(getActivity(), PayPalService.class);
intent.putExtra(PayPalService.EXTRA_PAYPAL_CONFIGURATION, config);
getActivity().startService(intent);

@lovetomorrow
Copy link

back to okhttp3 3.0.1

@sankarbhavanib
Copy link
Contributor

Fixed in 2.13.2

@Nedeos
Copy link

Nedeos commented Feb 22, 2016

Please reopen, the issue still remains with okhttp 3.1.2 and paypal-sdk 2.13.2 (Android 5.0.2 Motorola XT1068)

FATAL EXCEPTION: main                     Process: com.nedeos.barua, PID: 28110
                                                                  java.lang.RuntimeException: Unable to start service com.paypal.android.sdk.payments.PayPalService@3c1b05f9 with Intent { cmp=com.nedeos.barua/com.paypal.android.sdk.payments.PayPalService (has extras) }: java.lang.IllegalStateException: Unable to extract the trust manager on okhttp3.internal.Platform$Android@108d94c0, sslSocketFactory is class com.paypal.android.sdk.ck
                                                                      at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2913)
                                                                      at android.app.ActivityThread.access$2100(ActivityThread.java:148)
                                                                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1390)
                                                                      at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                      at android.os.Looper.loop(Looper.java:135)
                                                                      at android.app.ActivityThread.main(ActivityThread.java:5312)
                                                                      at java.lang.reflect.Method.invoke(Native Method)
                                                                      at java.lang.reflect.Method.invoke(Method.java:372)
                                                                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901)
                                                                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:696)
                                                                   Caused by: java.lang.IllegalStateException: Unable to extract the trust manager on okhttp3.internal.Platform$Android@108d94c0, sslSocketFactory is class com.paypal.android.sdk.ck
                                                                      at okhttp3.OkHttpClient.<init>(OkHttpClient.java:186)
                                                                      at okhttp3.OkHttpClient.<init>(OkHttpClient.java:60)
                                                                      at okhttp3.OkHttpClient$Builder.build(OkHttpClient.java:718)
                                                                      at com.paypal.android.sdk.cq.<init>(Unknown Source)
                                                                      at com.paypal.android.sdk.payments.PayPalService.a(Unknown Source)
                                                                      at com.paypal.android.sdk.payments.PayPalService.onStartCommand(Unknown Source)
                                                                      at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2896)
                                                                      at android.app.ActivityThread.access$2100(ActivityThread.java:148) 
                                                                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1390) 
                                                                      at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                      at android.os.Looper.loop(Looper.java:135) 
                                                                      at android.app.ActivityThread.main(ActivityThread.java:5312) 
                                                                      at java.lang.reflect.Method.invoke(Native Method) 
                                                                      at java.lang.reflect.Method.invoke(Method.java:372) 

@braebot
Copy link
Contributor

braebot commented Feb 22, 2016

@Nedeos, are you sure you updated okhttp correctly? @jaypatel512 might have some more information here. I just tested the sample app with okhttp 3.1.2 on my Nexus 10, with no problems.

@kroid333
Copy link

Still same issue in 2.13.2

@braebot braebot reopened this Feb 23, 2016
@braebot
Copy link
Contributor

braebot commented Feb 23, 2016

I confirmed this is still an issue. Looks like we had some obfuscation issues this time around, causing inconsistencies in our testing. Apologies for this. We'll submit another release shortly.

@braebot
Copy link
Contributor

braebot commented Feb 23, 2016

Fixed in 2.13.3.

@braebot braebot closed this as completed Feb 23, 2016
@kroid333
Copy link

Fixed.. Its working.. thank u 👍 :)

@jbaginski
Copy link
Author

we're still able to reproduce it using okhttp 3.1.2 and paypal 2.13.3

@braebot
Copy link
Contributor

braebot commented Feb 24, 2016

At this point the issue is fixed within the SampleApp, so your proguard settings may be obfuscating what we just fixed. Please try adding the following lines to your proguard file:

-keepclassmembers class * implements javax.net.ssl.SSLSocketFactory {
    private javax.net.ssl.SSLSocketFactory delegate;
}

@Nedeos
Copy link

Nedeos commented Feb 24, 2016

I also can confirm that it has been fixed. Our app runs using okhttp 3.1.2 and paypal 2.13.3. Thanks a lot.

@jbaginski
Copy link
Author

thanks @braebot, that solved the issue :)

@eolverabea
Copy link

eolverabea commented Jul 25, 2016

Have the same problem these are the mistakes that throws me: (Debug-ID).

[WARN] : W/paypal.sdk: fm SN:10 PayPal Debug-ID: ba70f9d9579b [sandbox, 2.14.2;release]
[WARN] : W/paypal.sdk: fg SN:12 PayPal Debug-ID: 1a508e303ae4c [sandbox, 2.14.2;release]
[WARN] : W/paypal.sdk: fd SN:13 PayPal Debug-ID: 253a4ff871291 [sandbox, 2.14.2;release]

@HassanJawed
Copy link

Please reopen, still facing this issue on paypal 2.15.2 and okhttp 3.6.0

I have also added this in proguard

-keepclassmembers class * implements javax.net.ssl.SSLSocketFactory {
    private javax.net.ssl.SSLSocketFactory delegate;
}

@anantshah93
Copy link

anantshah93 commented Jul 8, 2017

same issue, still facing this issue on paypal 2.15.2 and okhttp 3.4.1

@randstraw
Copy link

randstraw commented Jul 10, 2017

@anantshah93 since this issue was previously resolved can you please file a new issue with your error.

Thank you

Edit: Locking the thread. If the error is being experienced again, please create a new issue or look for a more recent open one.

@paypal paypal locked and limited conversation to collaborators Jul 10, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants