Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException in TLSCertificatePinning.getCertInputStream #477

Open
hankyjcheng opened this issue Jun 18, 2024 · 5 comments
Open

Comments

@hankyjcheng
Copy link

Braintree SDK Version

6.16.0

Environment

Production

Android Version & Device

No response

Braintree dependencies

com.braintreepayments.api:drop-in:6.16.0
com.braintreepayments.api:braintree-core:4.45.0

Describe the bug

This crash is captured on Firebase Crashlytics:

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'byte[] java.lang.String.getBytes(java.nio.charset.Charset)' on a null object reference
at com.braintreepayments.api.TLSCertificatePinning.getCertInputStream(TLSCertificatePinning.java:719)
at com.braintreepayments.api.BraintreeGraphQLClient$Companion.createDefaultHttpClient(BraintreeGraphQLClient.java:82)
at com.braintreepayments.api.BraintreeGraphQLClient$Companion.access$createDefaultHttpClient(BraintreeGraphQLClient.java:79)
at com.braintreepayments.api.BraintreeGraphQLClient.(BraintreeGraphQLClient.kt:6)
at com.braintreepayments.api.BraintreeClientParams.(BraintreeClientParams.kt:13)
at com.braintreepayments.api.BraintreeClientParams.(BraintreeClientParams.kt:22)
at com.braintreepayments.api.BraintreeClient.(BraintreeClient.kt:70)
at com.braintreepayments.api.DropInClient.createDefaultParams(DropInClient.java:50)
at com.braintreepayments.api.DropInClient.(DropInClient.java:163)

To reproduce

not reproducible by dev

Expected behavior

Should not have a crash

Screenshots

No response

@sshropshire
Copy link
Contributor

Hey @hankyjcheng thanks for using the Braintree SDK for Android and for filing this. Do you have any additional information about the environment in which the crash occurred e.g. Device Name, Device Manufacturer etc.?

@hankyjcheng
Copy link
Author

@sshropshire yeah it's happening on different major manufacturers like Samsung and Google. Here is a screen shot we have on Firebase Crashlytics. As you can see 96% occurred on Android 14.

Screen Shot 2024-07-08 at 11 52 26 AM

@ersen-lw
Copy link

Hello,

I got a crash report with the same issue a few days ago.

Using com.braintreepayments.api:drop-in:6.16.0

The crash also occurred on Android 14.

          Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'byte[] java.lang.String.getBytes(java.nio.charset.Charset)' on a null object reference
       at com.braintreepayments.api.TLSCertificatePinning.getCertInputStream(TLSCertificatePinning.java:719)
       at com.braintreepayments.api.BraintreeHttpClient$Companion.createDefaultHttpClient(BraintreeHttpClient.java:178)
       at com.braintreepayments.api.BraintreeHttpClient$Companion.access$createDefaultHttpClient(BraintreeHttpClient.java:172)
       at com.braintreepayments.api.BraintreeHttpClient.<init>(BraintreeHttpClient.kt:12)
       at com.braintreepayments.api.AnalyticsClient.<init>(AnalyticsClient.java:25)
       at com.braintreepayments.api.BraintreeClientParams.<init>(BraintreeClientParams.java:14)
       at com.braintreepayments.api.BraintreeClientParams.<init>(BraintreeClientParams.java:22)
       at com.braintreepayments.api.BraintreeClient.<init>(BraintreeClient.kt:70)
       at com.braintreepayments.api.DropInClient.createDefaultParams(DropInClient.java:50)
       at com.braintreepayments.api.DropInClient.<init>(DropInClient.java:163)
image

@BunnyBuddy
Copy link

Even in other issues I see java.lang.NullPointerException mostly in Android 14 and it seems some package or plugin being used by Braintree has some issues with Android 14. Because the same things are working fine on Android 13 and Android 15.

@PenguinDan
Copy link

Finding the same crashes on Android 14 devices

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

No branches or pull requests

5 participants