You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to implement the braintree flow in my app and it seems to work until I click "Cancel and return to.." or I go through the entire payment process and crashes when it has to return to the app.
This is the error I get
E/AndroidRuntime(11837): FATAL EXCEPTION: main
E/AndroidRuntime(11837): Process: net.castanet.app, PID: 11837
E/AndroidRuntime(11837): java.lang.RuntimeException: Unable to start activity ComponentInfo{net.castanet.app/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
E/AndroidRuntime(11837): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3645)
E/AndroidRuntime(11837): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3782)
E/AndroidRuntime(11837): at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
E/AndroidRuntime(11837): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
E/AndroidRuntime(11837): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
E/AndroidRuntime(11837): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2307)
E/AndroidRuntime(11837): at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime(11837): at android.os.Looper.loopOnce(Looper.java:201)
E/AndroidRuntime(11837): at android.os.Looper.loop(Looper.java:288)
E/AndroidRuntime(11837): at android.app.ActivityThread.main(ActivityThread.java:7872)
E/AndroidRuntime(11837): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(11837): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
E/AndroidRuntime(11837): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
E/AndroidRuntime(11837): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.os.Bundle.setClassLoader(java.lang.ClassLoader)' on a null object reference
E/AndroidRuntime(11837): at com.braintreepayments.api.DropInActivity.getDropInRequest(DropInActivity.java:124)
E/AndroidRuntime(11837): at com.braintreepayments.api.DropInActivity.onCreate(DropInActivity.java:78)
E/AndroidRuntime(11837): at android.app.Activity.performCreate(Activity.java:8305)
E/AndroidRuntime(11837): at android.app.Activity.performCreate(Activity.java:8284)
E/AndroidRuntime(11837): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1417)
E/AndroidRuntime(11837): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3626)
E/AndroidRuntime(11837): ... 12 more
I/Process (11837): Sending signal. PID: 11837 SIG: 9
Lost connection to device.
Exited.
This is my android manifest
<activity android:name="com.braintreepayments.api.DropInActivity"
android:launchMode="singleTask" android:exported="true" tools:node="merge">
<intent-filter tools:node="removeAll" />
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="${applicationId}.braintree" />
</intent-filter>
</activity>
<activity android:name="com.braintreepayments.api.ThreeDSecureActivity" tools:replace="android:theme" android:theme="@style/Theme.AppCompat.Light" android:exported="true">
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
<queries>
<intent>
<action android:name="android.intent.action.PROCESS_TEXT"/>
<data android:mimeType="text/plain"/>
</intent>
</queries>
And this is the function for triggering the payment process
I am trying to implement the braintree flow in my app and it seems to work until I click "Cancel and return to.." or I go through the entire payment process and crashes when it has to return to the app.
This is the error I get
E/AndroidRuntime(11837): FATAL EXCEPTION: main
E/AndroidRuntime(11837): Process: net.castanet.app, PID: 11837
E/AndroidRuntime(11837): java.lang.RuntimeException: Unable to start activity ComponentInfo{net.castanet.app/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
E/AndroidRuntime(11837): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3645)
E/AndroidRuntime(11837): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3782)
E/AndroidRuntime(11837): at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
E/AndroidRuntime(11837): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
E/AndroidRuntime(11837): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
E/AndroidRuntime(11837): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2307)
E/AndroidRuntime(11837): at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime(11837): at android.os.Looper.loopOnce(Looper.java:201)
E/AndroidRuntime(11837): at android.os.Looper.loop(Looper.java:288)
E/AndroidRuntime(11837): at android.app.ActivityThread.main(ActivityThread.java:7872)
E/AndroidRuntime(11837): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(11837): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
E/AndroidRuntime(11837): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
E/AndroidRuntime(11837): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.os.Bundle.setClassLoader(java.lang.ClassLoader)' on a null object reference
E/AndroidRuntime(11837): at com.braintreepayments.api.DropInActivity.getDropInRequest(DropInActivity.java:124)
E/AndroidRuntime(11837): at com.braintreepayments.api.DropInActivity.onCreate(DropInActivity.java:78)
E/AndroidRuntime(11837): at android.app.Activity.performCreate(Activity.java:8305)
E/AndroidRuntime(11837): at android.app.Activity.performCreate(Activity.java:8284)
E/AndroidRuntime(11837): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1417)
E/AndroidRuntime(11837): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3626)
E/AndroidRuntime(11837): ... 12 more
I/Process (11837): Sending signal. PID: 11837 SIG: 9
Lost connection to device.
Exited.
This is my android manifest
And this is the function for triggering the payment process
void startPayPalPayment(price, message, token) async {
final request = BraintreeDropInRequest(
clientToken: token,
collectDeviceData: true,
paypalRequest: BraintreePayPalRequest(
amount: price,
displayName: 'Castanet',
),
);
BraintreeDropInResult? result = await BraintreeDropIn.start(request);
if (result != null) {
print('Nonce: ${result.paymentMethodNonce.nonce}');
} else {
print('Selection was canceled.');
}
}
Any help is much appreciated.
The text was updated successfully, but these errors were encountered: