WalletConnect / WalletConnectUnity

WalletConnect v2 and Modal for Unity 🎮
MIT License
137 stars 48 forks source link

Connecting to Metamask doesn't work for most of the people #243

Open ammarvohra opened 2 weeks ago

ammarvohra commented 2 weeks ago

@skibitsky Describe the bug WalletConnect model view open up, click on MetaMask and sometimes the popup is blank and sometime user doesn't get connect popup on MetaMask and when they get, sometimes they are not redirected back to the game. This happens with lot of phone models and that is serious issue we got right now on our plate. Please help me resolve this issue

Expected behavior Expected to connect with the wallet

Screenshots Skype_Picture_2024_08_30T10_55_03_145Z

Environment

Is this happening in Unity Editor or on a player like Android, iOS, Windows? We just have Android version right now and it's happening in that

Wallets used for testing MetaMask

Additional context Bug report from Crashlytics:

       Fatal Exception: java.lang.Exception: AggregateException : One or more errors occurred. (Unable to connect to the remote server)
       at System.Threading.Tasks.Task.ThrowIfExceptional(System.Threading.Tasks.Task)
       at System.Threading.Tasks.Task`1[TResult].GetResultCore(System.Threading.Tasks.Task`1[TResult])
       at WalletConnectSharp.Common.Utils.Extensions.WithTimeout[T](WalletConnectSharp.Common.Utils.Extensions)
       at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext)
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run(System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner)
       at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Threading.Tasks.AwaitTaskContinuation)
       at System.Threading.Tasks.Task.FinishContinuations(System.Threading.Tasks.Task)
       at System.Threading.Tasks.Task`1[TResult].TrySetResult(System.Threading.Tasks.Task`1[TResult])
       at System.Threading.Tasks.TaskFactory+CompleteOnInvokePromise.Invoke(System.Threading.Tasks.TaskFactory+CompleteOnInvokePromise)
       at System.Threading.Tasks.Task.FinishContinuations(System.Threading.Tasks.Task)
       at System.Threading.Tasks.Task.Finish(System.Threading.Tasks.Task)
       at System.Threading.Tasks.Task.TrySetException(System.Threading.Tasks.Task)
       at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult].SetException(System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult])
       at WalletConnectSharp.Core.Controllers.Relayer.Request[T,TR](WalletConnectSharp.Core.Controllers.Relayer)
       at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext)
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run(System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner)
       at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Threading.Tasks.AwaitTaskContinuation)
       at System.Threading.Tasks.Task.FinishContinuations(System.Threading.Tasks.Task)
       at System.Threading.Tasks.Task.Finish(System.Threading.Tasks.Task)
       at System.Threading.Tasks.Task.TrySetException(System.Threading.Tasks.Task)
       at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult].SetException(System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult])
       at WalletConnectSharp.Network.JsonRpcProvider.Request[T,TR](WalletConnectSharp.Network.JsonRpcProvider)
       at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext)
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run(System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner)
       at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Threading.Tasks.AwaitTaskContinuation)
       at System.Threading.Tasks.Task.FinishContinuations(System.Threading.Tasks.Task)
       at System.Threading.Tasks.Task.Finish(System.Threading.Tasks.Task)
       at System.Threading.Tasks.Task.TrySetException(System.Threading.Tasks.Task)
       at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult].SetException(System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult])
       at WalletConnectSharp.Network.JsonRpcProvider.Connect(WalletConnectSharp.Network.JsonRpcProvider)
       at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext)
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run(System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner)
       at System.Threading.ThreadPoolWorkQueue.Dispatch(System.Threading.ThreadPoolWorkQueue)
       at WalletConnectSharp.Core.Controllers.Subscriber.RpcBatchSubscribe(WalletConnectSharp.Core.Controllers.Subscriber)
       at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext)
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run(System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner)
       at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Threading.Tasks.AwaitTaskContinuation)
       at System.Threading.Tasks.Task.FinishContinuations(System.Threading.Tasks.Task)
       at System.Threading.Tasks.Task.Finish(System.Threading.Tasks.Task)
       at System.Threading.Tasks.Task.TrySetException(System.Threading.Tasks.Task)
       at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult].SetException(System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult])
       at WalletConnectSharp.Common.Utils.Extensions.WithTimeout[T](WalletConnectSharp.Common.Utils.Extensions)
       at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext)
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run(System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner)
       at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Threading.Tasks.AwaitTaskContinuation)
       at System.Threading.Tasks.Task.FinishContinuations(System.Threading.Tasks.Task)
       at System.Threading.Tasks.Task`1[TResult].TrySetResult(System.Threading.Tasks.Task`1[TResult])
       at System.Threading.Tasks.TaskFactory+CompleteOnInvokePromise.Invoke(System.Threading.Tasks.TaskFactory+CompleteOnInvokePromise)
       at System.Threading.Tasks.Task.FinishContinuations(System.Threading.Tasks.Task)
       at System.Threading.Tasks.Task.Finish(System.Threading.Tasks.Task)
       at System.Threading.Tasks.Task.TrySetException(System.Threading.Tasks.Task)
       at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult].SetException(System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult])
       at WalletConnectSharp.Core.Controllers.Relayer.Request[T,TR](WalletConnectSharp.Core.Controllers.Relayer)
       at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext)
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run(System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner)
       at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Threading.Tasks.AwaitTaskContinuation)
       at System.Threading.Tasks.Task.FinishContinuations(System.Threading.Tasks.Task)
       at System.Threading.Tasks.Task.Finish(System.Threading.Tasks.Task)
       at System.Threading.Tasks.Task.TrySetException(System.Threading.Tasks.Task)
       at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult].SetException(System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult])
       at WalletConnectSharp.Network.JsonRpcProvider.Request[T,TR](WalletConnectSharp.Network.JsonRpcProvider)
       at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext)
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run(System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner)
       at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Threading.Tasks.AwaitTaskContinuation)
       at System.Threading.Tasks.Task.FinishContinuations(System.Threading.Tasks.Task)
       at System.Threading.Tasks.Task.Finish(System.Threading.Tasks.Task)
       at System.Threading.Tasks.Task.TrySetException(System.Threading.Tasks.Task)
       at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult].SetException(System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult])
       at WalletConnectSharp.Network.JsonRpcProvider.Connect(WalletConnectSharp.Network.JsonRpcProvider)
       at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext)
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run(System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner)
       at System.Threading.ThreadPoolWorkQueue.Dispatch(System.Threading.ThreadPoolWorkQueue)
       at WalletConnectSharp.Core.Controllers.Subscriber.BatchSubscribe(WalletConnectSharp.Core.Controllers.Subscriber)
       at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext)
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run(System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner)
       at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Threading.Tasks.AwaitTaskContinuation)
       at System.Threading.Tasks.Task.FinishContinuations(System.Threading.Tasks.Task)
       at System.Threading.Tasks.Task.Finish(System.Threading.Tasks.Task)
       at System.Threading.Tasks.Task.TrySetException(System.Threading.Tasks.Task)
       at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult].SetException(System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult])
       at WalletConnectSharp.Core.Controllers.Subscriber.RpcBatchSubscribe(WalletConnectSharp.Core.Controllers.Subscriber)
       at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext)
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run(System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner)
       at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Threading.Tasks.AwaitTaskContinuation)
       at System.Threading.Tasks.Task.FinishContinuations(System.Threading.Tasks.Task)
       at System.Threading.Tasks.Task.Finish(System.Threading.Tasks.Task)
       at System.Threading.Tasks.Task.TrySetException(System.Threading.Tasks.Task)
       at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult].SetException(System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult])
       at WalletConnectSharp.Common.Utils.Extensions.WithTimeout[T](WalletConnectSharp.Common.Utils.Extensions)
       at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext)
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run(System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner)
       at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Threading.Tasks.AwaitTaskContinuation)
       at System.Threading.Tasks.Task.FinishContinuations(System.Threading.Tasks.Task)
       at System.Threading.Tasks.Task`1[TResult].TrySetResult(System.Threading.Tasks.Task`1[TResult])
       at System.Threading.Tasks.TaskFactory+CompleteOnInvokePromise.Invoke(System.Threading.Tasks.TaskFactory+CompleteOnInvokePromise)
       at System.Threading.Tasks.Task.FinishContinuations(System.Threading.Tasks.Task)
       at System.Threading.Tasks.Task.Finish(System.Threading.Tasks.Task)
       at System.Threading.Tasks.Task.TrySetException(System.Threading.Tasks.Task)
       at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult].SetException(System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult])
       at WalletConnectSharp.Core.Controllers.Relayer.Request[T,TR](WalletConnectSharp.Core.Controllers.Relayer)
       at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext)
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run(System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner)
       at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Threading.Tasks.AwaitTaskContinuation)
       at System.Threading.Tasks.Task.FinishContinuations(System.Threading.Tasks.Task)
       at System.Threading.Tasks.Task.Finish(System.Threading.Tasks.Task)
       at System.Threading.Tasks.Task.TrySetException(System.Threading.Tasks.Task)
       at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult].SetException(System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult])
       at WalletConnectSharp.Network.JsonRpcProvider.Request[T,TR](WalletConnectSharp.Network.JsonRpcProvider)
       at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext)
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run(System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner)
       at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Threading.Tasks.AwaitTaskContinuation)
       at System.Threading.Tasks.Task.FinishContinuations(System.Threading.Tasks.Task)
       at System.Threading.Tasks.Task.Finish(System.Threading.Tasks.Task)
       at System.Threading.Tasks.Task.TrySetException(System.Threading.Tasks.Task)
       at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult].SetException(System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult])
       at WalletConnectSharp.Network.JsonRpcProvider.Connect(WalletConnectSharp.Network.JsonRpcProvider)
       at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext)
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run(System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner)
       at System.Threading.ThreadPoolWorkQueue.Dispatch(System.Threading.ThreadPoolWorkQueue)
       at WalletConnectSharp.Core.Controllers.Subscriber.CheckPending(WalletConnectSharp.Core.Controllers.Subscriber)
       at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext)
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run(System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner)
       at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Threading.Tasks.AwaitTaskContinuation)
       at System.Threading.Tasks.Task.FinishContinuations(System.Threading.Tasks.Task)
       at System.Threading.Tasks.Task.Finish(System.Threading.Tasks.Task)
       at System.Threading.Tasks.Task.TrySetException(System.Threading.Tasks.Task)
       at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult].SetException(System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult])
       at WalletConnectSharp.Core.Controllers.Subscriber.BatchSubscribe(WalletConnectSharp.Core.Controllers.Subscriber)
       at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext)
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run(System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner)
       at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Threading.Tasks.AwaitTaskContinuation)
       at System.Threading.Tasks.Task.FinishContinuations(System.Threading.Tasks.Task)
       at System.Threading.Tasks.Task.Finish(System.Threading.Tasks.Task)
       at System.Threading.Tasks.Task.TrySetException(System.Threading.Tasks.Task)
       at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult].SetException(System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult])
       at WalletConnectSharp.Core.Controllers.Subscriber.RpcBatchSubscribe(WalletConnectSharp.Core.Controllers.Subscriber)
       at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext)
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run(System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner)
       at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Threading.Tasks.AwaitTaskContinuation)
       at System.Threading.Tasks.Task.FinishContinuations(System.Threading.Tasks.Task)
       at System.Threading.Tasks.Task.Finish(System.Threading.Tasks.Task)
       at System.Threading.Tasks.Task.TrySetException(System.Threading.Tasks.Task)
       at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult].SetException(System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult])
       at WalletConnectSharp.Common.Utils.Extensions.WithTimeout[T](WalletConnectSharp.Common.Utils.Extensions)
       at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext)
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run(System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner)
       at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Threading.Tasks.AwaitTaskContinuation)
       at System.Threading.Tasks.Task.FinishContinuations(System.Threading.Tasks.Task)
       at System.Threading.Tasks.Task`1[TResult].TrySetResult(System.Threading.Tasks.Task`1[TResult])
       at System.Threading.Tasks.TaskFactory+CompleteOnInvokePromise.Invoke(System.Threading.Tasks.TaskFactory+CompleteOnInvokePromise)
       at System.Threading.Tasks.Task.FinishContinuations(System.Threading.Tasks.Task)
       at System.Threading.Tasks.Task.Finish(System.Threading.Tasks.Task)
       at System.Threading.Tasks.Task.TrySetException(System.Threading.Tasks.Task)
       at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult].SetException(System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult])
       at WalletConnectSharp.Core.Controllers.Relayer.Request[T,TR](WalletConnectSharp.Core.Controllers.Relayer)
       at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext)
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run(System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner)
       at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Threading.Tasks.AwaitTaskContinuation)
       at System.Threading.Tasks.Task.FinishContinuations(System.Threading.Tasks.Task)
       at System.Threading.Tasks.Task.Finish(System.Threading.Tasks.Task)
       at System.Threading.Tasks.Task.TrySetException(System.Threading.Tasks.Task)
       at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult].SetException(System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult])
       at WalletConnectSharp.Network.JsonRpcProvider.Request[T,TR](WalletConnectSharp.Network.JsonRpcProvider)
       at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext)
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run(System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner)
       at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Threading.Tasks.AwaitTaskContinuation)
       at System.Threading.Tasks.Task.FinishContinuations(System.Threading.Tasks.Task)
       at System.Threading.Tasks.Task.Finish(System.Threading.Tasks.Task)
       at System.Threading.Tasks.Task.TrySetException(System.Threading.Tasks.Task)
       at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult].SetException(System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult])
       at WalletConnectSharp.Network.JsonRpcProvider.Connect(WalletConnectSharp.Network.JsonRpcProvider)
       at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext)
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run(System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner)
       at System.Threading.ThreadPoolWorkQueue.Dispatch(System.Threading.ThreadPoolWorkQueue)
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_1(System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c)
       at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext)
       at System.Threading.ThreadPoolWorkQueue.Dispatch(System.Threading.ThreadPoolWorkQueue)
skibitsky commented 2 weeks ago

Hello,

Does this issue occur only on Android device, or does it also happen in the Editor? If it does happen in the Editor, have you noticed whether the target platform in the build settings affects it (e.g. can you reproduce the issue if the target platform is set to Windows)?

ammarvohra commented 2 weeks ago

No I've not faced this issue on Unity Editor, this happens on Android devices only.

skibitsky commented 2 weeks ago

Do you use any proxy or VPN on Android?

Could you please also try changing the relay url in the WalletConnectProjectConfig scriptable asset from wss://relay.walletconnect.com to wss://relay.walletconnect.org? The former one isn't accessible in some regions.

ammarvohra commented 2 weeks ago

I am not sure with the VPN because I cannot connect with all of my users, and do you think that changing the relay url will solve the problem?

skibitsky commented 2 weeks ago

I am not sure with the VPN because I cannot connect with all of my users, and do you think that changing the relay url will solve the problem?

That error message is pretty vague. It's possible that the issue is caused by poor connection on the client side. But I still recommend you to update the url because wss://relay.walletconnect.org can be accessed from restricted areas, such as the PRC. We now use it as the default relay url, but if you imported the SDK into the project a while ago, you may still be using the old url.

skibitsky commented 2 weeks ago

@ammarvohra is it possible to identify when approximately did start receiving reports of Fatal Exception: java.lang.Exception: AggregateException : One or more errors occurred. (Unable to connect to the remote server)?

What Android versions are affected? Phone models?

ammarvohra commented 2 weeks ago

@skibitsky Numbers of models are affected, I am sharing the screenshots:

WalletConnect WalletConnect2 WalletConnect3 WalletConnect4

ammarvohra commented 1 week ago

@skibitsky Even after changing the Relay url, they can't see the popup where redirect happens

PFA vlcsnap-2024-09-01-22h20m53s971

ammarvohra commented 1 week ago

@skibitsky do you know why this issue is happening?

ammarvohra commented 1 week ago

https://github.com/user-attachments/assets/f129186e-515b-4b61-884c-cfddf187e8ee

skibitsky commented 1 week ago

I've been trying to reproduce the issue across different Android versions by simulating poor network conditions, but so far, I've had no success. It's possible that the issue is caused by another dependency. Do you use NativeWebSocket directly or is it integrated through any third-party dependency in your project?

Another possibility is that this could be a Unity bug. Although it's unlikely to solve the issue, it could be worth trying the classic Unity troubleshooting steps: deleting the Library folder and making a clean Android build.

ammarvohra commented 1 week ago

No I don't use NativeWebSocket neither directly nor with 3rd party plugins. Apart from WalletConnect I am using, ReadyPlayerMe and Nethereum packages. Though I'll give it a try to create a clean build.

skibitsky commented 1 week ago

@ammarvohra could you please also try setting Internet Access to Require in the Player settings for Android?

ammarvohra commented 1 week ago

@skibitsky If you want to try with our game, this is the game link: https://play.google.com/store/apps/details?id=com.gami.knockoutwars Use ALPHA as invite code that will let you get registered.

ammarvohra commented 1 week ago

@skibitsky We have that as Required field, though I'll double check that one

skibitsky commented 1 week ago

Thank you for providing the link 🙏

I've tested your game on both physical and virtual Android devices with various OS versions and network conditions, but so far, I haven't been able to reproduce the issue.

Do the users experiencing this issue happen to share the same location?

ammarvohra commented 1 week ago

I haven't checked the user location yet will do it tomorrow, but one of our community member reported this issue first from Nigeria, I'll check other locations too and will update you.

ammarvohra commented 1 week ago

@skibitsky I've checked the backend data and the Countries that are replicating this issues are Nigeria, Egypt and Indonesia (major issues from Nigeria), if you could rectify the problem and solution that would be great.

Also on a quick note that I tried giving Nigerian person a build with Metamask sdk, and that worked fine for them.

ammarvohra commented 1 week ago

@skibitsky Clean build doesn't resolved the issue either, but when they connect VPN to different location they were able to go through next screen and they are redirected to the Metamask.

So is there any other solution that can helps us to resolve this issue? We need to start the campaign, marketing, etc as we are on final phase to release this game to public, so if you could help us figure this out it would be a great help. Thanks.

skibitsky commented 1 week ago

@ammarvohra I opened a PR that replaces NativeWebSocket with another library. Could you please try installing com.walletconnect.core from that branch? One way to do that is to place com.walletconnect.core folder into Packages directory in your Unity project.

ammarvohra commented 1 week ago

@skibitsky Sure, I'll do that and will update you.

Thanks

ammarvohra commented 1 week ago

@skibitsky that also worked with VPN not without it

skibitsky commented 1 week ago

@ammarvohra, it's probably the network issue on the user side.

ammarvohra commented 1 week ago

@skibitsky But the VPN thing works well for them, and it's about most of the people in Nigeria