Skip to content

IllegalStateException: LifecycleOwner com.modesens.androidapp.MainActivity@e185ef7 is attempting to register while current state is RESUMED. LifecycleOwners must call register before they are STARTED. #501

@sjqnice

Description

@sjqnice

Braintree SDK Version

6.17.0

Environment

Sandbox

Android Version & Device

Samsung SM-A5160 - Android 13

Braintree dependencies

com.braintreepayments.api:drop-in:6.17.0

Describe the bug

  1. `LifecycleEventEffect(Lifecycle.Event.ON_CREATE) {
  2.                 if (estimateWrapper.paymentChannels.contains("bt")){
    
  3.                     dropInClient = DropInClient(context as AppCompatActivity,estimateWrapper.braintreeToken)
    
  4.                 }
    
  5. }`

Third line crash with the java.lang.IllegalStateException: LifecycleOwner com.modesens.androidapp.MainActivity@e185ef7 is attempting to register while current state is RESUMED. LifecycleOwners must call register before.

To reproduce

When I use init DropInClient in Jetpack Compose, it crash with the java.lang.IllegalStateException: LifecycleOwner com.modesens.androidapp.MainActivity@e185ef7 is attempting to register while current state is RESUMED. LifecycleOwners must call register before.

Expected behavior

How to use it in Single Activity + Jetpack Compose right way.

Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions