Comments (22)
@Khaldi-Anouar Thanks for your report. Our team will see if this is something we can fix or maybe is a Unity 2021.3 bug.
from unity-web3-game-kit.
@Khaldi-Anouar I did a test with Unity 2021.3.8f1 and using Chrome version 105.0.5195.52 (Officiële build) (64-bits) and all seems to be working. Maybe Unity 2021.3.7f1 has a issue. Could you test with version 2021.3.8f1?
from unity-web3-game-kit.
@Khaldi-Anouar I did a test with Unity 2021.3.8f1 and using Chrome version 105.0.5195.52 (Officiële build) (64-bits) and all seems to be working. Maybe Unity 2021.3.7f1 has a issue. Could you test with version 2021.3.8f1?
Hello, I tried with unity 2021.3.8f1 (Empty project with moralis), it doesn't work
can you try on different browsers please?
from unity-web3-game-kit.
Which browser are you using? Does the introduction scene work?
from unity-web3-game-kit.
@KoenRijpstra yeah everything works fine until I click on connect and I sign with Metamask
this is the build link https://crimin.itch.io/newmoralis
from unity-web3-game-kit.
Which browser are you testing on?
from unity-web3-game-kit.
More than one browser! chrome, opera, edge, brave, in some computers it's working on them all, is some computers it working only in some of them, in some computers it doesn't work on all of them
from unity-web3-game-kit.
@Khaldi-Anouar We tested on multiple browser and can't replicate the issue. If it is working on some computers and not on others what is the difference between those computers?
from unity-web3-game-kit.
Same problem:
https://forum.moralis.io/t/unity-moralis-v1-2-7-unauthorized-problem/19297/10
I am using Unity 2021.3.9f1 (latest stable) and i created empty project. And i added moralis v1.2.7 (latest). Also, i created ropsten test server with moralis. But when i try to connect with my metamask wallet, it has many errors. How can i fix?
Note: I am trying on Unity Editor.
from unity-web3-game-kit.
@Khaldi-Anouar I did a test with Unity 2021.3.8f1 and using Chrome version 105.0.5195.52 (Officiële build) (64-bits) and all seems to be working. Maybe Unity 2021.3.7f1 has a issue. Could you test with version 2021.3.8f1?
I installed 2021.3.8f1 and tried with moralis v1.2.7 sdk on Unity Editor. But it's not working. Wallet cannot connect.
from unity-web3-game-kit.
@Khaldi-Anouar @newbiedev1 Which version of the Moralis server is your dapp running? You can find it in your admin dashboard:
from unity-web3-game-kit.
@Khaldi-Anouar @newbiedev1 Which version of the Moralis server is your dapp running? You can find it in your admin dashboard:
I am using v0.0.385 server version. Also, i tried with moralis v1.1.0 and wallet connection is working on Unity Editor. But latest moralis sdks are not working (i tried with v1.2.5 and v1.2.7).
from unity-web3-game-kit.
@newbiedev1 same like you version, my version is v0.0.385
from unity-web3-game-kit.
@Khaldi-Anouar @newbiedev1 Which version of the Moralis server is your dapp running? You can find it in your admin dashboard:
I am using v0.0.385 server version. Also, i tried with moralis v1.1.0 and wallet connection is working on Unity Editor. But latest moralis sdks are not working (i tried with v1.2.5 and v1.2.7).
Unity version: 2021.3.8f1
Moralis SDK version: v1.2.7
Server version: v0.0.385
i created empty project. And i added moralis v1.2.7 (latest). Also, i created ropsten test server with moralis. But when i try to connect with my metamask wallet, it has many errors. I have no problem with moralis v1.1.0 sdk.
from unity-web3-game-kit.
Isn't there a solution?
from unity-web3-game-kit.
At this time we have tried every combination given to us and we have not been able to replicate this issue.
Please do this:
- Open your project in Visual Studio.
- In the Solution Explorer, find and open this file: Packages / io.moralis.web3-unity-sdk / Runtime / Core / Platform / Services / MoralisCommandRunner.cs
- Go to line 60
Tuple<Status, string> cmdResult = await GetWebClient().ExecuteAsync(cmd); //, uploadProgress, downloadProgress, cancellationToken);
- Go to line 60:
Tuple<Status, string> cmdResult = await GetWebClient().ExecuteAsync(cmd);
- Add this code:
foreach (KeyValuePair<string, string> kvp in cmd.Headers)
{
Debug.Log($"{kvp.Key}: {kvp.Value}");
}
5a. If the Debug
is not found, add a using UnityEngine;
statement at the top of the file.
6. Run the app.
7. At authentication, if you receive the error, check the Console log.
8. If the headers were logged, please copy these as TEXT and post them in a new comment.
9. If the headers were not logged something else is going on. Please go to your Moralis Server logs. If there are errors please copy the last error logged in a new comment.
Thank you.
from unity-web3-game-kit.
At this time we have tried every combination given to us and we have not been able to replicate this issue.
Please do this:
- Open your project in Visual Studio.
- In the Solution Explorer, find and open this file: Packages / io.moralis.web3-unity-sdk / Runtime / Core / Platform / Services / MoralisCommandRunner.cs
- Go to line 60
Tuple<Status, string> cmdResult = await GetWebClient().ExecuteAsync(cmd); //, uploadProgress, downloadProgress, cancellationToken);
- Go to line 60:
Tuple<Status, string> cmdResult = await GetWebClient().ExecuteAsync(cmd);
- Add this code:
foreach (KeyValuePair<string, string> kvp in cmd.Headers) { Debug.Log($"{kvp.Key}: {kvp.Value}"); }
5a. If the
Debug
is not found, add ausing UnityEngine;
statement at the top of the file. 6. Run the app. 7. At authentication, if you receive the error, check the Console log. 8. If the headers were logged, please copy these as TEXT and post them in a new comment. 9. If the headers were not logged something else is going on. Please go to your Moralis Server logs. If there are errors please copy the last error logged in a new comment.Thank you.
Thank you for reply. Debug.log:
Content-Type: application/json
UnityEngine.Debug:Log (object)
MoralisUnity.Platform.Services.ClientServices.MoralisCommandRunner1/<RunCommandAsync>d__17<MoralisUnity.Platform.Objects.MoralisUser>:MoveNext () (at Packages/io.moralis.web3-unity-sdk/Runtime/Core/Platform/Services/ClientServices/MoralisCommandRunner.cs:64) Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask
2<MoralisUnity.Platform.Services.ClientServices.MoralisCommandRunner1/<RunCommandAsync>d__17<MoralisUnity.Platform.Objects.MoralisUser>, System.Tuple
2<System.Net.HttpStatusCode, string>>:Run () (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/CompilerServices/StateMachineRunner.cs:313)
Cysharp.Threading.Tasks.AwaiterActions:Continuation (object) (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/UniTask.cs:21)
Cysharp.Threading.Tasks.UniTaskCompletionSourceCore1<System.Tuple
2<System.Net.HttpStatusCode, string>>:TrySetResult (System.Tuple2<System.Net.HttpStatusCode, string>) (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/UniTaskCompletionSource.cs:139) Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask
2<MoralisUnity.Platform.Services.UniversalWebClient/d__7, System.Tuple2<System.Net.HttpStatusCode, string>>:SetResult (System.Tuple
2<System.Net.HttpStatusCode, string>) (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/CompilerServices/StateMachineRunner.cs:328)
MoralisUnity.Platform.Services.UniversalWebClient/d__7:MoveNext () (at Packages/io.moralis.web3-unity-sdk/Runtime/Core/Platform/Services/ClientServices/UniversalWebClient.cs:114)
Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask2<MoralisUnity.Platform.Services.UniversalWebClient/<ExecuteAsync>d__7, System.Tuple
2<System.Net.HttpStatusCode, string>>:Run () (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/CompilerServices/StateMachineRunner.cs:313)
Cysharp.Threading.Tasks.Internal.PooledDelegate`1<UnityEngine.AsyncOperation>:Run (UnityEngine.AsyncOperation) (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/Internal/PooledDelegate.cs:46)
UnityEngine.AsyncOperation:InvokeCompletionEvent ()
from unity-web3-game-kit.
I tested Unity 2021.3.3f1, 2021.3.4f1, 2021.3.8f1, 2021.3.9f1, 2020.3.0f1. Also, i used moralis sdk 1.2.5 and 1.2.7. Same error on all of them. But , i have tested with moralis old sdk (v1.1.0) and unity 2021.3.9f1, there is no problem. Wallet connection is working.
First error:
Target: https://dhwor46zhuia.usemoralis.com:2053/server/users
UnityEngine.Debug:LogError (object)
MoralisUnity.Platform.Services.UniversalWebClient/d__7:MoveNext () (at Packages/io.moralis.web3-unity-sdk/Runtime/Core/Platform/Services/ClientServices/UniversalWebClient.cs:87)
Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask2<MoralisUnity.Platform.Services.UniversalWebClient/<ExecuteAsync>d__7, System.Tuple
2<System.Net.HttpStatusCode, string>>:Run () (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/CompilerServices/StateMachineRunner.cs:313)
Cysharp.Threading.Tasks.Internal.PooledDelegate`1<UnityEngine.AsyncOperation>:Run (UnityEngine.AsyncOperation) (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/Internal/PooledDelegate.cs:46)
UnityEngine.AsyncOperation:InvokeCompletionEvent ()
Second error:
Error: HTTP/1.1 403 Forbidden
{"error":"unauthorized"}
UnityEngine.Debug:LogError (object)
MoralisUnity.Platform.Services.UniversalWebClient/d__7:MoveNext () (at Packages/io.moralis.web3-unity-sdk/Runtime/Core/Platform/Services/ClientServices/UniversalWebClient.cs:88)
Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask2<MoralisUnity.Platform.Services.UniversalWebClient/<ExecuteAsync>d__7, System.Tuple
2<System.Net.HttpStatusCode, string>>:Run () (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/CompilerServices/StateMachineRunner.cs:313)
Cysharp.Threading.Tasks.Internal.PooledDelegate`1<UnityEngine.AsyncOperation>:Run (UnityEngine.AsyncOperation) (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/Internal/PooledDelegate.cs:46)
UnityEngine.AsyncOperation:InvokeCompletionEvent ()
Warning error:
LogInAsync failed: {"error":"unauthorized"}
UnityEngine.Debug:Log (object)
MoralisUnity.Platform.Services.ClientServices.MoralisUserService1/<LogInAsync>d__19<MoralisUnity.Platform.Objects.MoralisUser>:MoveNext () (at Packages/io.moralis.web3-unity-sdk/Runtime/Core/Platform/Services/ClientServices/MoralisUserService.cs:106) Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask
2<MoralisUnity.Platform.Services.ClientServices.MoralisUserService1/<LogInAsync>d__19<MoralisUnity.Platform.Objects.MoralisUser>, MoralisUnity.Platform.Objects.MoralisUser>:Run () (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/CompilerServices/StateMachineRunner.cs:313) Cysharp.Threading.Tasks.AwaiterActions:Continuation (object) (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/UniTask.cs:21) Cysharp.Threading.Tasks.UniTaskCompletionSourceCore
1<System.Tuple2<System.Net.HttpStatusCode, string>>:TrySetResult (System.Tuple
2<System.Net.HttpStatusCode, string>) (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/UniTaskCompletionSource.cs:139)
Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask2<MoralisUnity.Platform.Services.ClientServices.MoralisCommandRunner
1/d__17<MoralisUnity.Platform.Objects.MoralisUser>, System.Tuple2<System.Net.HttpStatusCode, string>>:SetResult (System.Tuple
2<System.Net.HttpStatusCode, string>) (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/CompilerServices/StateMachineRunner.cs:328)
MoralisUnity.Platform.Services.ClientServices.MoralisCommandRunner1/<RunCommandAsync>d__17<MoralisUnity.Platform.Objects.MoralisUser>:MoveNext () (at Packages/io.moralis.web3-unity-sdk/Runtime/Core/Platform/Services/ClientServices/MoralisCommandRunner.cs:88) Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask
2<MoralisUnity.Platform.Services.ClientServices.MoralisCommandRunner1/<RunCommandAsync>d__17<MoralisUnity.Platform.Objects.MoralisUser>, System.Tuple
2<System.Net.HttpStatusCode, string>>:Run () (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/CompilerServices/StateMachineRunner.cs:313)
Cysharp.Threading.Tasks.AwaiterActions:Continuation (object) (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/UniTask.cs:21)
Cysharp.Threading.Tasks.UniTaskCompletionSourceCore1<System.Tuple
2<System.Net.HttpStatusCode, string>>:TrySetResult (System.Tuple2<System.Net.HttpStatusCode, string>) (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/UniTaskCompletionSource.cs:139) Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask
2<MoralisUnity.Platform.Services.UniversalWebClient/d__7, System.Tuple2<System.Net.HttpStatusCode, string>>:SetResult (System.Tuple
2<System.Net.HttpStatusCode, string>) (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/CompilerServices/StateMachineRunner.cs:328)
MoralisUnity.Platform.Services.UniversalWebClient/d__7:MoveNext () (at Packages/io.moralis.web3-unity-sdk/Runtime/Core/Platform/Services/ClientServices/UniversalWebClient.cs:114)
Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask2<MoralisUnity.Platform.Services.UniversalWebClient/<ExecuteAsync>d__7, System.Tuple
2<System.Net.HttpStatusCode, string>>:Run () (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/CompilerServices/StateMachineRunner.cs:313)
Cysharp.Threading.Tasks.Internal.PooledDelegate`1<UnityEngine.AsyncOperation>:Run (UnityEngine.AsyncOperation) (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/Internal/PooledDelegate.cs:46)
UnityEngine.AsyncOperation:InvokeCompletionEvent ()
Third error:
NullReferenceException: Object reference not set to an instance of an object
MoralisUnity.Platform.Services.ClientServices.UserServiceExtensions.LogInWithAsync[TUser] (MoralisUnity.Platform.Abstractions.IServiceHub1[TUser] serviceHub, System.String authType, System.Collections.Generic.IDictionary
2[TKey,TValue] data, System.Threading.CancellationToken cancellationToken) (at Packages/io.moralis.web3-unity-sdk/Runtime/Core/Platform/Services/ClientServices/UserServiceExtensions.cs:202)
Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask2[TStateMachine,T].GetResult (System.Int16 token) (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/CompilerServices/StateMachineRunner.cs:342) MoralisUnity.MoralisClient.LogInAsync (System.Collections.Generic.IDictionary
2[TKey,TValue] data, System.Threading.CancellationToken cancellationToken) (at Packages/io.moralis.web3-unity-sdk/Runtime/Core/MoralisClient.cs:221)
Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask2[TStateMachine,T].GetResult (System.Int16 token) (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/CompilerServices/StateMachineRunner.cs:342) MoralisUnity.Moralis.LogInAsync (System.Collections.Generic.IDictionary
2[TKey,TValue] authData, System.Int32 chainId) (at Packages/io.moralis.web3-unity-sdk/Runtime/Core/Moralis.cs:320)
Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask`2[TStateMachine,T].GetResult (System.Int16 token) (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/CompilerServices/StateMachineRunner.cs:342)
MoralisUnity.Kits.AuthenticationKit.AuthenticationKit.WalletConnect_SignAndLoginToMoralis (WalletConnectSharp.Unity.WalletConnectUnitySession session) (at Packages/io.moralis.web3-unity-sdk/Runtime/Kits/AuthenticationKit/Scripts/AuthenticationKit.cs:387)
System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.b__7_0 (System.Object state) (at <6073cf49ed704e958b8a66d540dea948>:0)
UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at :0)
UnityEngine.UnitySynchronizationContext.Exec () (at :0)
UnityEngine.UnitySynchronizationContext.ExecuteTasks () (at :0)
from unity-web3-game-kit.
At this time we have tried every combination given to us and we have not been able to replicate this issue.
Please do this:
- Open your project in Visual Studio.
- In the Solution Explorer, find and open this file: Packages / io.moralis.web3-unity-sdk / Runtime / Core / Platform / Services / MoralisCommandRunner.cs
- Go to line 60
Tuple<Status, string> cmdResult = await GetWebClient().ExecuteAsync(cmd); //, uploadProgress, downloadProgress, cancellationToken);
- Go to line 60:
Tuple<Status, string> cmdResult = await GetWebClient().ExecuteAsync(cmd);
- Add this code:
foreach (KeyValuePair<string, string> kvp in cmd.Headers) { Debug.Log($"{kvp.Key}: {kvp.Value}"); }
5a. If the
Debug
is not found, add ausing UnityEngine;
statement at the top of the file. 6. Run the app. 7. At authentication, if you receive the error, check the Console log. 8. If the headers were logged, please copy these as TEXT and post them in a new comment. 9. If the headers were not logged something else is going on. Please go to your Moralis Server logs. If there are errors please copy the last error logged in a new comment.Thank you.
Are there any solution 🙂
from unity-web3-game-kit.
Hello @xactant
I tried what you ask then I took a WebGL build, the headers are correct in both devices (device A where we can and device B where we can't login)
both of them are giving the same debugs, but when I check the headers, there's some missing parameters x-parse-installation-id
and x-parse-application-id
This is the device A (or browser A) no missing headers:
This is the device B (or browser B) with missing headers
from unity-web3-game-kit.
@Khaldi-Anouar Does this only happen with users on Turkish networks?
from unity-web3-game-kit.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
from unity-web3-game-kit.
Related Issues (20)
- [BUG] Unity WEBGL problem with multiple Live queries. HOT 11
- 'Strip engine code' higher than low (player settings) causes important constructors to be stripped from MoralisUser HOT 7
- Moralis conflicts the photon plugin, websocket.jslib conflicts with the one in photon websocket jslib HOT 3
- WalletConnect Session Reconnection (pls) HOT 3
- unity webgl minting not work HOT 2
- Can't update MoralisUser fields after few seconds HOT 3
- "code":206,"error":"Insufficient auth." HOT 8
- NFTs no longer showing, using cloud, did not touch app in about a month HOT 1
- Unity webGL - Execute Contract Function - Minting Issue (HexBigInteger - Invalid Big Number Returned (Error: invalid BigNumber string)) HOT 6
- Web3 Game Kit Package v1.2.7 missing .unitypackage HOT 1
- WalletConnect has been destroyed HOT 3
- Error: HTTP/1.1 400 Bad Request {"code":206,"error":"Insufficient auth."} HOT 12
- ExecuteContractFunction gives transaction error HOT 4
- v1.2.7 Unauthorized Problem HOT 5
- v1.2.10 WebGL Build not Connecting HOT 9
- Paybale function showing JSON-RPC error on Metamask HOT 3
- SDK No longer works with Moralis V2 or Self Hosted V1 HOT 1
- Not Compatible with WalletConnect v2 HOT 1
- Not compatible with WalletConnect v2 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unity-web3-game-kit.