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

flutter briantree version 4.0.0 crash in android #158

Open
TuanMai777 opened this issue Apr 26, 2024 · 3 comments
Open

flutter briantree version 4.0.0 crash in android #158

TuanMai777 opened this issue Apr 26, 2024 · 3 comments

Comments

@TuanMai777
Copy link

Hello,
I am using flutter version 4.0.0
I am using method
final request = BraintreeCreditCardRequest(
cardNumber: '4111111111111111',
expirationMonth: '12',
expirationYear: '2021',
cvv: '123',
);
final result = await Braintree.tokenizeCreditCard(
tokenizationKey,
request,
);

I got the error below,

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(error, Unable to find explicit activity class {com.your-company.your-app/com.example.flutter_braintree.FlutterBraintreeCustom}; have you declared this activity in your AndroidManifest.xml, or does your intent not match its declared ?, null, android.content.ActivityNotFoundException: Unable to find explicit activity class {com.your-company.your-app/com. example.flutter_braintree.FlutterBraintreeCustom}; have you declared this activity in your AndroidManifest.xml, or does your intent not match its declared ?

@TuanMai777 TuanMai777 changed the title flutter briantree version 4 flutter briantree version 4.0.0 crash app android Apr 27, 2024
@TuanMai777 TuanMai777 changed the title flutter briantree version 4.0.0 crash app android flutter briantree version 4.0.0 crash in android Apr 27, 2024
@BunnyBuddy
Copy link

BunnyBuddy commented Apr 29, 2024

In your code (if you have this as an external dependency) at this location,

flutter-braintree/android/src/main/AndroidManifest.xml

replace the code under application tag to below,

<application>
    <activity android:name=".FlutterBraintreeCustom"
        android:exported="true"
        android:theme="@style/bt_transparent_activity">
    </activity>
    <activity android:name=".DropInActivity"
        android:theme="@style/bt_transparent_activity">
    </activity>
</application>

And then do (for android studio)
flutter clean
invalidate cache and restart

@TuanMai777
Copy link
Author

TuanMai777 commented Apr 30, 2024

Hi @BunnyBuddy

I ran the code with the example given in the plugin but the app crashed with paypal
When I click the "PAYPAL VAULT FLOW" button
Then go to the "checkout.paypal.com" screen
I clicked the blue button "Proceed with Sandbox Purchase"
The app crashes with the error given

Worker result FAILURE for Work [ id=454e0e52-d3a8-4109-8625-dcf1661ded4d, tags={ com.braintreepayments.api.AnalyticsUploadWorker } ]
D/AndroidRuntime(31400): Shutting down VM
E/AndroidRuntime(31400): FATAL EXCEPTION: main
E/AndroidRuntime(31400): Process: com.example.flutter_braintree_example, PID: 31400
E/AndroidRuntime(31400): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.flutter_braintree_example/com.braintreepayments.api.DropInActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.os.Bundle.setClassLoader(java.lang.ClassLoader)' on a null object reference

image

image

@TuanMai777
Copy link
Author

Hi @BunnyBuddy
The issue will probably be the same
#153

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

2 participants