question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Receiving error with Paypal DropIn

See original GitHub issue

General information

  • Sandbox
  • [Emulator] Nexus 6P - 7.0
  • [Actual device] Nexus 5 - 6.0.1

Receiving this error

Rejecting re-init on previously-failed class java.lang.Class<com.braintreepayments.api.BraintreeFragment$15>: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/api/GoogleApiClient$ConnectionCallbacks;

I’m using Kotlin btw, if that’s helpful information.

Steps to replicate

  1. Call this method
fun onBraintreeSubmit() {
        val dropInRequest = DropInRequest()
                .clientToken(clientToken)
        startActivityForResult(dropInRequest.getIntent(this), REQUEST_CODE_PAY)
    }
  1. Select Paypal
  2. Tap Proceed with Sandbox Purchase

I followed the setup links here

On my app level build.gradle i have compile 'com.braintreepayments.api:braintree:2.9.0' compile 'com.braintreepayments.api:drop-in:3.+'

On the MainActivity

  • In oncreate I do
braintreeFragment = BraintreeFragment.newInstance(this@MainActivity, clientToken)
        braintreeFragment.addListener(this@MainActivity)
  • I also have a click listener that initializes a DropIn
val dropInRequest = DropInRequest()
                .clientToken(clientToken)
        startActivityForResult(dropInRequest.getIntent(this), REQUEST_CODE_PAY)

Where the clientToken is the sample token from the docs eyJ2ZXJzaW9uIj...ib2ZmIn0=

I also saw issue #109 so I tried doing a compile 'com.google.android.gms:play-services:8.4.0' But it seems to break my project.

Just want to understand what’s causing the error

Thank you

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
rjnsalvadorcommented, Jan 31, 2018

To add, after applying the plugin in my app/build.gradle

classpath ‘com.google.gms:google-services:3.1.1’

I get

Version: 8.4.0 is lower than the minimum version (9.0.0) required for google-services plugin.

On Wed, Jan 31, 2018 at 11:30 AM, Ramon Salvador rjnsalvador@gmail.com wrote:

Okay, so I removed the braintree dependency. so now I only have and its not breaking anymore

compile ‘com.google.android.gms:play-services:8.4.0’

compile ‘com.braintreepayments.api:drop-in:3.+’

But I get an error below GoogleService failed to initialize, status: 10, Missing an expected resource: ‘R.string.google_app_id’ for initializing Google services. Possible causes are missing google-services.json or com.google.gms.google-services gradle plugin.

Should I register my project on the Firebase console? Going to this link https://developers.google.com/mobile/add, after adding my app name and package, it makes me choose among Sign in, Analytics and Cloud messaging. Which should be chosen here to get a google-services.json.

I think you should include this part on your docs as well… hmmm

On Wed, Jan 31, 2018 at 4:38 AM, Blade Barringer <notifications@github.com

wrote:

You should not be including the braintree dependency, as that is bundled into the drop-in dependency. Including both com.braintreepayments.api:braintree and com.braintreepayments.api:drop-in can cause issues.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/braintree/braintree_android/issues/184#issuecomment-361726517, or mute the thread https://github.com/notifications/unsubscribe-auth/AB26UFCFrJu8gF8rShhxNKeEySyRiSW4ks5tP33DgaJpZM4RvtUb .

1reaction
rjnsalvadorcommented, Jan 31, 2018

Okay, so I removed the braintree dependency. so now I only have and its not breaking anymore

compile ‘com.google.android.gms:play-services:8.4.0’

compile ‘com.braintreepayments.api:drop-in:3.+’

But I get an error below GoogleService failed to initialize, status: 10, Missing an expected resource: ‘R.string.google_app_id’ for initializing Google services. Possible causes are missing google-services.json or com.google.gms.google-services gradle plugin.

Should I register my project on the Firebase console? Going to this link https://developers.google.com/mobile/add, after adding my app name and package, it makes me choose among Sign in, Analytics and Cloud messaging. Which should be chosen here to get a google-services.json.

I think you should include this part on your docs as well… hmmm

On Wed, Jan 31, 2018 at 4:38 AM, Blade Barringer notifications@github.com wrote:

You should not be including the braintree dependency, as that is bundled into the drop-in dependency. Including both com.braintreepayments.api: braintree and com.braintreepayments.api:drop-in can cause issues.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/braintree/braintree_android/issues/184#issuecomment-361726517, or mute the thread https://github.com/notifications/unsubscribe-auth/AB26UFCFrJu8gF8rShhxNKeEySyRiSW4ks5tP33DgaJpZM4RvtUb .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Authorization - Braintree Developer Documentation
Code Text Type 2000 Do Not Honor Soft 2001 Insufficient Funds Soft 2002 Limit Exceeded Soft
Read more >
Braintree dropinUI not working with Paypal "Client Error"
I am using the drop-in UI. However, whenever I click on the PayPal option, it closes the payment menu and kicks back the...
Read more >
Dropin - Documentation - Braintree Open Source
This class represents a Drop-in component, that will create a pre-made UI for accepting cards and PayPal on your page. Instances of this...
Read more >
PayPal Drop-in integration - Adyen Docs
Our Android Drop-in renders PayPal in your payment form, and redirects the shopper to complete the payment. As with other redirect payment methods, ......
Read more >
Drop-in UI | Customization | JavaScript - Braintree
This is useful when the transaction fails and you want to show an error ... when the customer selects a new payment method...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found