I'm trying to help debug Wallet Connect (v2) integration into an Android app written in Kotlin (I know Java, but am not an Android/Kotlin dev myself).
I get an exception from the com.walletconnect:android-core
library and would like to set a breakpoint (or insert some debug printing) for inspection.
Even though I would appreciate any help with Wallet Connect directly, the main purpose of this question is to figure out how I can go about debugging this myself.
The library is included in Gradle by
implementation("com.walletconnect:android-core:1.3.0")
implementation("com.walletconnect:sign:2.1.0")
The error comes from JsonRpcInteractor
(seemlingly method manageSubscriptions
) (no idea why they're wrapping it in java.lang.InternalError
as it's not a JVM error):
java.lang.InternalError: JsonRpcInteractor: Received unknown object type
at com.walletconnect.android.impl.json_rpc.domain.JsonRpcInteractor$handleError$1.invokeSuspend(JsonRpcInteractor.kt:271)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
In Android Studio, under External Libraries, I can only find the interface JsonRpcInteractorInterface
that JsonRpcInteractor
implements, but not the class itself. The class is declared as internal class
, which I suppose might be the reason?
As I can't find the class, I also cannot set a breakpoint within it. Is there some trick that would enable me to still set a breakpoint in this class?
Following this I also tried to replace the dependency with a local copy where I added some print statements. But in none of the variants I tried was gradle able to find the library project.
I was able to build the full WalletConnectKotlinV2
project using ./gradlew installDebug
from the repo root (it contains other components besides android-core
). But haven't been able to figure out exactly where it installs what. If only I could build the library into a jar
, I might be able to more easily link it into the project.