WalletConnectKotlinV2 icon indicating copy to clipboard operation
WalletConnectKotlinV2 copied to clipboard

[Bug] samples.dapp always crash when it call pushRequest.

Open nhatpv-1627 opened this issue 1 year ago • 4 comments

Describe the bug I'm running examples of this repo: samples.dapp and sample.wallet. I've added google-services.json and done paring them successfully as in the picture below. Then I tap the Push request button, the app immediately crashes below:

FATAL EXCEPTION: main
Process: com.walletconnect.sample.dapp, PID: 9212
 java.util.NoSuchElementException: Collection contains no element matching the predicate.
at com.walletconnect.sample.dapp.ui.routes.composable_routes.session.SessionViewModel.pushRequest(SessionViewModel.kt:173)
at com.walletconnect.sample.dapp.ui.routes.composable_routes.session.SessionRouteKt$SessionRoute$6.invoke(SessionRoute.kt:76)
at com.walletconnect.sample.dapp.ui.routes.composable_routes.session.SessionRouteKt$SessionRoute$6.invoke(SessionRoute.kt:76)
at com.walletconnect.sample_common.ui.commons.ButtonsKt$BlueButton$1$1.invoke(Buttons.kt:27)
at com.walletconnect.sample_common.ui.commons.ButtonsKt$BlueButton$1$1.invoke(Buttons.kt:26)
at androidx.compose.foundation.ClickableKt$clickable$4$gesture$1$1$2.invoke-k-4lQ0M(Clickable.kt:167)
at androidx.compose.foundation.ClickableKt$clickable$4$gesture$1$1$2.invoke(Clickable.kt:156)
at androidx.compose.foundation.gestures.TapGestureDetectorKt$detectTapAndPress$2$1.invokeSuspend(TapGestureDetector.kt:255)

I've checked and found out that SignClient.getListOfActiveSessions() always be empty. Please help to check. Did I miss any config?

SDK Version (if relevant)

  • Client: [e.g. JS, Swift, Kotlin]
  • Version [e.g. 22]

To Reproduce Steps to reproduce the behavior:

  1. Run samples.dapp and sample.wallet
  2. Connect(pair) dapp with wallet
  3. Pair successfully then click to Request push button
  4. See the error

Expected behavior Send Request push to the wallet to approve. Then Dapp can Notify to Wallet

Screenshots image

Additional context Add any other context about the problem here.

nhatpv-1627 avatar Jun 22 '23 04:06 nhatpv-1627

By the way, I've tried to add FCM API key to Console . But It's not finished. After debugging, I found that there was an error in this API:

image

image image Please help to check!

nhatpv-1627 avatar Jun 22 '23 11:06 nhatpv-1627

Another issue, the WalletApp approves Request Push from Dapp successfully in UI, but I found the error in Logcat here:

java.lang.Throwable: {"status":"FAILURE","error":{"name":"cacao","message":"Unable to verify"},"value":null} at com.walletconnect.android.keyserver.domain.use_case.UtilsKt.unwrapUnit(Utils.kt:17) at com.walletconnect.android.keyserver.domain.use_case.RegisterIdentityUseCase.invoke-gIAlu-s(RegisterIdentityUseCase.kt:11) at com.walletconnect.android.keyserver.domain.use_case.RegisterIdentityUseCase$invoke$1.invokeSuspend(Unknown Source:12) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)

So I think the WalletApp approved Request Push from Dapp failed actually!

nhatpv-1627 avatar Jun 23 '23 04:06 nhatpv-1627

@arein Could you reply to me? Is there any way can I try?

nhatpv-1627 avatar Jun 27 '23 08:06 nhatpv-1627

@TalhaAli00 can you pls take a look?

arein avatar Jun 27 '23 12:06 arein