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

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

Open
Raenar4k opened this issue May 28, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@Raenar4k
Copy link

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

  • Client: Kotlin
  • Version 1.31.4

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

@Raenar4k Raenar4k added the bug Something isn't working label May 28, 2024
@jakubuid
Copy link
Contributor

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

@jakubuid
Copy link
Contributor

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

@Raenar4k
Copy link
Author

@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

@jakubuid
Copy link
Contributor

Hey, I meant in AndroidManifest. I was able to reproduce and fix by setting this in AndroidManifest of my sample app

@Raenar4k
Copy link
Author

As you can see, we have 23 of these attributes in our AndroidManifest file.
image

Which xml tag with this attribute affects Koin?

    <application
        android:name=".App"
        <activity
            android:windowSoftInputMode="adjustResize"
            android:name="com.test.app.AppActivity"
        <service
            android:name=".feature.push.FirebasePushService"
        <provider
            android:name="androidx.core.content.FileProvider"
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            

There are others but i doubt they are relevant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants