WalletConnect / WalletConnectKotlinV2

WalletConnect Kotlin SDK v2
Apache License 2.0
197 stars 71 forks source link

Crash on calling Web3ModalComponent Composable - org.koin.core.error.NoBeanDefFoundException Web3ModalEngine #1413

Open Raenar4k opened 3 months ago

Raenar4k commented 3 months ago

Describe the bug

Crash when we are calling Web3ModalComponent composable function:

java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:562)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)
Caused by: java.lang.reflect.InvocationTargetException
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878) 
Caused by: java.lang.reflect.InvocationTargetException
    at java.lang.reflect.Constructor.newInstance0(Native Method)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
...
    at androidx.lifecycle.viewmodel.compose.ViewModelKt__ViewModelKt.viewModel(ViewModel.kt:103)
    at androidx.lifecycle.viewmodel.compose.ViewModelKt.viewModel(Unknown Source:1)
    at com.walletconnect.web3.modal.ui.components.internal.Web3ModalComponentKt.Web3ModalComponent(Web3ModalComponent.kt:122)
    at com.walletconnect.web3.modal.ui.components.internal.Web3ModalComponentKt.Web3ModalComponent(Web3ModalComponent.kt:40)
...
    at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109)
    at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35)
...
    at android.os.Looper.loop(Looper.java:317)
    at android.app.ActivityThread.main(ActivityThread.java:8501)
    ... 3 more
Caused by: org.koin.core.error.NoBeanDefFoundException: No definition found for type 'com.walletconnect.web3.modal.engine.Web3ModalEngine'. Check your Modules configuration and add missing type and/or qualifier!
    at org.koin.core.scope.Scope.throwDefinitionNotFound(Scope.kt:302)
    at org.koin.core.scope.Scope.resolveValue(Scope.kt:272)
    at org.koin.core.scope.Scope.resolveInstance(Scope.kt:234)
    at org.koin.core.scope.Scope.get(Scope.kt:213)
    at com.walletconnect.web3.modal.ui.Web3ModalViewModel.<init>(Web3ModalViewModel.kt:47)
    ... 114 more

SDK Version

To Reproduce Steps to reproduce the behavior:

  1. Call Web3ModalComponent in compose code.

Expected behavior Compose function works correctly, we get a WC modal UI

jakubuid commented 1 week ago

Hello, I'll take a look into this shortly, thanks

jakubuid commented 2 days ago

@Raenar4k can you check if you have android:name tag in your Manifest file?

Raenar4k commented 16 hours ago

@jakubuid What do you mean? android:name attribute can be used in multiple places. Yes, we use it for our application, activity, service, provider and other places too. Im not sure where should i be looking and how it is connected to koin crash