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

[BUG] android.util.SuperNotCalledException: Activity did not call through to super.onCreate() #9610

Open
orbisanddev opened this issue Nov 13, 2024 · 0 comments
Labels

Comments

@orbisanddev
Copy link

orbisanddev commented Nov 13, 2024

Summary

somehow code was working fine few days ago when I do code in onCreate of activity with hardcoded values but now it's not working either in onCreate or call from any other method - I had tried all possible ways but still ended on same crash every time. My requirement is to call API for fetching values and then open payment sheet

Crash

Process: com.my.project, PID: 9016
android.util.SuperNotCalledException: Activity {com.my.project/com.stripe.android.paymentsheet.PaymentSheetActivity} did not call through to super.onCreate()
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3661)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3813)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2308)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7898)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

Code to reproduce

public class MyApplication extends Application {
@OverRide
public void onCreate() {
super.onCreate();
PaymentConfiguration.init(this, mPublishableKey);
}

@Override
public void onTrimMemory(int level) {
    super.onTrimMemory(level);
    TerminalApplicationDelegate.onTrimMemory(this, level);
}

}

@OverRide
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_checkout_);
paymentSheet = new PaymentSheet(this, this::onPaymentSheetResult);
stripeSheetAPI();
}

private void stripeSheetAPI() {
// API call which returns below values for opening payment sheet
// {"ClientSecret":"pi_3QKgIfHRNANdyxYR0TSjGM73_secret_xaMOlpcYvnGZ0yTPAQxSmtnNV","PaymentIntentId":"pi_3QKgIfHRNANdyxYR0TSjGM73","EphemeralKey":"ephkey_1QKgIfHRNANdyxYRSxLBM5oq","Customer":"cus_QzvceiboJJEUY3","PublishableKey":"pk_test_51BxyCLG70h4WjDez5rBtiQGVvS1YPqAcG3n0MjgqDc4uDpsIcveH12PgnXZl0D2oPLNJDwA3l1bangabN3e3yys500BpVUPMyx"}

    paymentIntentClientSecret = jsonObject.optString("PaymentIntentId");
    paymentClientSecret = jsonObject.optString("PaymentIntentId");
    presentPaymentSheet();

}

private void presentPaymentSheet() {
final PaymentSheet.Configuration configuration = new PaymentSheet.Configuration.Builder("Example, Inc.")
.customer(customerConfig)
.allowsDelayedPaymentMethods(true)
.build();
// paymentSheet.presentWithPaymentIntent(
// paymentClientSecret,
// configuration
// );
paymentSheet.presentWithPaymentIntent(
paymentClientSecret,
null
);
}

Android version

Android 13

Impacted devices

the issue is on all device but currently I'm using Google Pixel 4xl

Installation method

Dependency Versions

implementation 'com.stripe:stripe-android:20.15.4'

java:
stripe-android:
Android Gradle Plugin:
Gradle:

SDK classes

Video

Other information

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

No branches or pull requests

1 participant