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

android.view.WindowLeaked: Activity com.sumup.merchant.reader.ui.activities.CardReaderPaymentAPIDrivenPageActivity has leaked window DecorView@974c875[CardReaderPaymentAPIDrivenPageActivity] #147

Open
steveetm opened this issue Nov 2, 2020 · 0 comments

Comments

@steveetm
Copy link

steveetm commented Nov 2, 2020

I had to upgrade from 3.2.0 to 3.3.0 and getting this runtime error since then. We use this sdk in a cordova plugin like this:

      SumUpPayment payment = SumUpPayment.builder()
        .total(amount)
        .currency(currency)
        .title(title)
        .skipSuccessScreen()
        .build();

      Runnable runnable = () -> {
        SumUpAPI.checkout(cordova.getActivity(), payment, REQUEST_CODE_PAYMENT);
      };

      callback = callbackContext;
      cordova.setActivityResultCallback(this);
      cordova.getActivity().runOnUiThread(runnable);

This was working fine with 3.2.0, but since 3.3.0 I get the error in the title, with the following stack:

 E WindowManager: android.view.WindowLeaked: Activity com.sumup.merchant.reader.ui.activities.CardReaderPaymentAPIDrivenPageActivity has leaked window DecorView@974c875[CardReaderPaymentAPIDrivenPageActivity] that was originally added here
    at android.view.ViewRootImpl.<init>(ViewRootImpl.java:793)
    at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:461)
    at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:95)
    at android.app.Dialog.show(Dialog.java:507)
    at com.sumup.merchant.reader.helpers.ProgressDialogHelper.createDialog(SourceFile:15)
    at com.sumup.merchant.reader.helpers.ProgressDialogHelper.getDialog(SourceFile:20)
    at com.sumup.merchant.reader.helpers.ProgressDialogHelper.getDialog(SourceFile:24)
    at com.sumup.merchant.reader.helpers.ProgressDialogHelper.getProcessingDialog(SourceFile:29)
    at com.sumup.merchant.reader.ui.activities.CardReaderPaymentAPIDrivenPageActivity.sendTerminalSDKCheckoutRequest(SourceFile:356)
    at com.sumup.merchant.reader.ui.activities.CardReaderPaymentAPIDrivenPageActivity.onSafeCreate(SourceFile:152)
    at com.sumup.merchant.reader.ui.activities.SumUpReaderModuleBaseActivity.onCreate(SourceFile:50)
    at android.app.Activity.performCreate(Activity.java:7963)
    at android.app.Activity.performCreate(Activity.java:7952)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3629)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3806)
    at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
    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:2267)
    at android.os.Handler.dispatchMessage(Handler.java:107)
    at android.os.Looper.loop(Looper.java:237)
    at android.app.ActivityThread.main(ActivityThread.java:8167)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)

Before this call we check if the user is already logged in with this:

 Runnable runnable = () -> {
        callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, SumUpAPI.isLoggedIn()));
      };
      cordova.getActivity().runOnUiThread(runnable);

Which works fine

Any suggestions? I couldn't find much info in the release notes of 3.3.0:/
Thanks in advance.

pnbuild pushed a commit to PoweredNow/cordova-plugin-sumup that referenced this issue Nov 2, 2020
The SDK itself is not yet working, sumup/sumup-android-sdk#147
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

1 participant