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 crash related to CardFieldView #1768

Open
gpawlik1 opened this issue Nov 5, 2024 · 1 comment
Open

Android crash related to CardFieldView #1768

gpawlik1 opened this issue Nov 5, 2024 · 1 comment

Comments

@gpawlik1
Copy link

gpawlik1 commented Nov 5, 2024

Describe the bug
There is a Android crash being reported that apparently originates from the CardViewField. I assume that the solution might be to delay any actions on ComposeView until it’s fully attached to the window, potentially using a listener like ViewTreeObserver.OnGlobalLayoutListener to ensure the view is attached.

 Fatal Exception: java.lang.IllegalStateException: Cannot locate windowRecomposer; View androidx.compose.ui.platform.ComposeView{72bc6f4 V.E...... ......I. 0,0-103,53 #7f0a01ce app:id/icon} is not attached to a window
       at androidx.compose.ui.platform.WindowRecomposer_androidKt.getWindowRecomposer(WindowRecomposer.android.kt:295)
       at androidx.compose.ui.platform.AbstractComposeView.resolveParentCompositionContext(ComposeView.android.kt:244)
       at androidx.compose.ui.platform.AbstractComposeView.ensureCompositionCreated(ComposeView.android.kt:251)
       at androidx.compose.ui.platform.AbstractComposeView.onMeasure(ComposeView.android.kt:288)
       at android.view.View.measure(View.java:25532)
       at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6957)
       at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
       at android.view.View.measure(View.java:25532)
       at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6957)
       at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1552)
       at android.widget.LinearLayout.measureHorizontal(LinearLayout.java:1204)
       at android.widget.LinearLayout.onMeasure(LinearLayout.java:723)
       at android.view.View.measure(View.java:25532)
       at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6957)
       at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
       at android.view.View.measure(View.java:25532)
       at com.reactnativestripesdk.CardFieldView.mLayoutRunnable$lambda$27(CardFieldView.kt:384)
       at com.reactnativestripesdk.CardFieldView.$r8$lambda$tO4Ku94GLM16x8NhrR7Up5q0VFs()
       at com.reactnativestripesdk.CardFieldView$$ExternalSyntheticLambda2.run(:2)
       at android.os.Handler.handleCallback(Handler.java:938)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:250)
       at android.app.ActivityThread.main(ActivityThread.java:7886)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:970)
        

Smartphone (please complete the following information):

  • Device: Model:Motorola One 5G Ace
  • OS: Android
  • Version 11
@iM-GeeKy
Copy link

iM-GeeKy commented Nov 5, 2024

Potentially related to #1732 (comment). @charliecruzan-stripe Is there any update on that issue?

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