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

Unable to bind to service com.paypal.android.sdk.payments.PayPalService #117

Closed
nzakharchenko opened this issue Dec 4, 2014 · 13 comments
Closed
Labels

Comments

@nzakharchenko
Copy link

Hello guys!

In my app, I'm using the latest SDK (2.7.1) and starting service like described in sample app:

final PayPalConfiguration PP_CONFIG = BuildConfig.DEBUG ? PP_CONFIG_SANDBOX : PP_CONFIG_RELEASE;
PP_CONFIG.merchantName("somename").languageOrLocale("en");
Intent intent = new Intent(this, PayPalService.class).putExtra(PayPalService.EXTRA_PAYPAL_CONFIGURATION, PP_CONFIG);
startService(intent);

I'm sure that intent is not null and extras also are not null, but from time to time I'm getting such error:

java.lang.RuntimeException: Unable to bind to service com.paypal.android.sdk.payments.PayPalService@413d9408 with Intent { cmp=de.meinfernbus/com.paypal.android.sdk.payments.PayPalService (has extras) }: java.lang.RuntimeException: Service extras required. Please see the docs.
    at android.app.ActivityThread.handleBindService(ActivityThread.java:2747)
    at android.app.ActivityThread.access$1700(ActivityThread.java:162)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1451)
    at android.os.Handler.dispatchMessage(Handler.java:107)
    at android.os.Looper.loop(Looper.java:194)
    at android.app.ActivityThread.main(ActivityThread.java:5371)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:525)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
    at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: Service extras required. Please see the docs.
    at com.paypal.android.sdk.payments.PayPalService.a(Unknown Source)
    at com.paypal.android.sdk.payments.PayPalService.onBind(Unknown Source)
    at android.app.ActivityThread.handleBindService(ActivityThread.java:2734)
    ... 10 more

Also the same error appeared on previous SDK versions.

@TravisAlmey
Copy link

Minor nitpick: latest SDK is 2.7.3

Also, are you setting your clientId?

@braebot
Copy link
Contributor

braebot commented Dec 4, 2014

Can you specify what "time to time" means? When do you start/stop the service? This error only occurs if the intent or its extras are null.

@nzakharchenko
Copy link
Author

Wow! New versions appears so fast :) I'll update to the latest one tomorrow, before app release.
Yes, sure, I'm sending client id. Here is config:

PayPalConfiguration PP_CONFIG_RELEASE = new PayPalConfiguration()
            .environment(PayPalConfiguration.ENVIRONMENT_PRODUCTION)
            .clientId("client_id_here")
            .acceptCreditCards(false)
            .rememberUser(true);

This crash appears only in production mode.

Service starting in onCreate(), before starting PaymentPayPalActivity. Destroying service are done in onDestroy(). "From time to time" means that is appears approximately for 1% of users, and are not reproducible on sandbox environment.

@braebot
Copy link
Contributor

braebot commented Dec 6, 2014

So you're not able to reproduce this yourself in the production environment? Do you notice if the crashing occurs on a certain set of devices, or is the distribution pretty even across device types? We haven't seen this error in any of our testing, so it leads me to believe there are other factors at play.

@braebot
Copy link
Contributor

braebot commented Dec 9, 2014

I was able to reproduce this issue, although not intentionally. I believe it occurs when the something has been cleared from memory, and the service attempts to restart itself.

@nzakharchenko
Copy link
Author

Yes, you are right, I'm not able reproduce it neither on sandbox mode not in production mode. Looks like it appears without any dependencies to device or Android version.
That's very cool that you were able reproduce it, do you have any idea what steps should be done for reproducing?

@braebot
Copy link
Contributor

braebot commented Dec 9, 2014

It happened when I left our sample app backgrounded overnight while in the middle of testing. When I tried to open the app again the next day, something changed, and we see the crash. If you have a device lying around, I'm sure you can test and may see the same behavior.

@nzakharchenko
Copy link
Author

Ok! I'll check it in that way!

@nzakharchenko
Copy link
Author

Your steps for reproducing bug is correct! I've reproduced the bug. I've left paypal app opened for long time (near 3-4h) and then after unlocking phone try press button "Pay" - app was crashed.

@braebot
Copy link
Contributor

braebot commented Dec 10, 2014

Excellent! We're working on fixing this, as well as some other defects at the moment. Thanks for your patience!

@ChristianKatzmann
Copy link

Can't wait for the fix to be released. I ran into the same issue according to a Crashlytics report.

@braebot
Copy link
Contributor

braebot commented Dec 12, 2014

Fixed in 2.8.2+.

@braebot braebot closed this as completed Dec 12, 2014
@braebot
Copy link
Contributor

braebot commented Dec 12, 2014

Please make note of the release notes, and the recommended changes to the integration.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants