-
Notifications
You must be signed in to change notification settings - Fork 89
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
Unable to run Austin Json RPC in Xamarin anroid. #87
Comments
I've never tested it on Xamarin Android. Are you hosting a JsonRpc server on Android? |
Thank you for your response.
Yes...I am using that via Supersocket server.
My platforms IOS, MacOS, Android and Windows are expected to connect to my Web socket server and access our Json RPC methods. It’s working in Mac/IOS but not in Android. I am looking for some assistance to move ahead with that.
I still need to test the same from Windows Desktop App though...
Thanks and Regards
Venky Adabala
… On Nov 6, 2017, at 1:52 PM, Austin Harris ***@***.***> wrote:
I've never tested it on Xamarin Android.
Are you hosting a JsonRpc server on Android?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
If your platforms IOS, MacOS, Android and Windows are all acting as Json-Rpc clients that connect to your Web Socket Server (Windows?) then the simplest solution would be to only use this library Json-Rpc.Net for the Web Socket Server. If you need a client library, there is a class here: (https://github.com/Astn/JSON-RPC.NET/blob/master/AustinHarris.JsonRpc.Client/client.cs) that you could copy into your project and make any adjustments needed to get it to compile. Alternatively there are quite a few json-rpc clients available out there, and you could opt to use Json-rpc.net only for the server side. |
Hello Austin,
On iOS, when the web socket server calls JSONProcessor.Process to process an incoming message, the following error is thrown by Newtonsoft.Json due to an iOS limitation whereby dynamic code generation is not allowed.
Here is the link to the Xamarin ios limitations page
https://developer.xamarin.com/guides/ios/advanced_topics/limitations/
Here is the stack trace if it can help...to address IOS issue.
2017-11-14 17:14:48.078 k4app.iOS[10031:15543300] {"id":"1","method":"Add","params":[100,20],"jsonrpc":"2.0"}
Thread finished: <Thread Pool> #6
2017-11-14 17:15:03.602 k4app.iOS[10031:15543303] warning: Could not load signature of Newtonsoft.Json.Utilities.DynamicReflectionDelegateFactory:CreateDynamicMethod due to: Could not resolve type with token 01000081 (from typeref, class/assembly System.Reflection.Emit.DynamicMethod, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) assembly:mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 type:System.Reflection.Emit.DynamicMethod member:<none>
2017-11-14 17:15:03.607 k4app.iOS[10031:15543303] warning: Could not load signature of Newtonsoft.Json.Utilities.DynamicReflectionDelegateFactory:CreateDynamicMethod due to: Could not resolve type with token 01000081 (from typeref, class/assembly System.Reflection.Emit.DynamicMethod, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) assembly:mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 type:System.Reflection.Emit.DynamicMethod member:<none>
2017-11-14 17:15:03.647 k4app.iOS[10031:15543301] 11/14/2017 5:15:03 PM [Error] Application Error System.TypeLoadException: Failure has occurred while loading a type.
at Newtonsoft.Json.Serialization.DefaultContractResolver.GetDefaultCreator (System.Type createdType) [0x00005] in <dc86da7fc46c487ba6c7ab826da479cc>:0
at Newtonsoft.Json.Serialization.DefaultContractResolver.InitializeContract (Newtonsoft.Json.Serialization.JsonContract contract) [0x00093] in <dc86da7fc46c487ba6c7ab826da479cc>:0
at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateObjectContract (System.Type objectType) [0x00007] in <dc86da7fc46c487ba6c7ab826da479cc>:0
at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateContract (System.Type objectType) [0x00026] in <dc86da7fc46c487ba6c7ab826da479cc>:0
at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveContract (System.Type type) [0x00029] in <dc86da7fc46c487ba6c7ab826da479cc>:0
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.GetContractSafe (System.Object value) [0x00016] in <dc86da7fc46c487ba6c7ab826da479cc>:0
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize (Newtonsoft.Json.JsonWriter jsonWriter, System.Object value, System.Type objectType) [0x00028] in <dc86da7fc46c487ba6c7ab826da479cc>:0
at Newtonsoft.Json.JsonSerializer.SerializeInternal (Newtonsoft.Json.JsonWriter jsonWriter, System.Object value, System.Type objectType) [0x00253] in <dc86da7fc46c487ba6c7ab826da479cc>:0
at Newtonsoft.Json.JsonSerializer.Serialize (Newtonsoft.Json.JsonWriter jsonWriter, System.Object value, System.Type objectType) [0x00000] in <dc86da7fc46c487ba6c7ab826da479cc>:0
at Newtonsoft.Json.JsonConvert.SerializeObjectInternal (System.Object value, System.Type type, Newtonsoft.Json.JsonSerializer jsonSerializer) [0x00028] in <dc86da7fc46c487ba6c7ab826da479cc>:0
at Newtonsoft.Json.JsonConvert.SerializeObject (System.Object value, System.Type type, Newtonsoft.Json.JsonSerializerSettings settings) [0x00007] in <dc86da7fc46c487ba6c7ab826da479cc>:0
at Newtonsoft.Json.JsonConvert.SerializeObject (System.Object value) [0x00000] in <dc86da7fc46c487ba6c7ab826da479cc>:0
at AustinHarris.JsonRpc.JsonRpcProcessor.ProcessInternal (System.String sessionId, System.String jsonRpc, System.Object jsonRpcContext) [0x00055] in <a23216d030344e51b444960b9b5f9536>:0
at AustinHarris.JsonRpc.JsonRpcProcessor+<>c.<Process>b__3_0 (System.Object _) [0x00019] in <a23216d030344e51b444960b9b5f9536>:0
at System.Threading.Tasks.Task`1[TResult].InnerInvoke () [0x0002b] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.3.0.47/src/mono/mcs/class/referencesource/mscorlib/system/threading/Tasks/Future.cs:686
at System.Threading.Tasks.Task.Execute () [0x00010] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.3.0.47/src/mono/mcs/class/referencesource/mscorlib/system/threading/Tasks/Task.cs:2502
2017-11-14 17:15:03.650 k4app.iOS[10031:15543301] Close!
Any assistance in this regard is much helpful.
Thanks and Regards,
Venky
|
My best guess for you would be to try building a custom version of Json-rpc.net that references the version of the Json library that works on IOS. |
This should be resolved by #90 |
Error: Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'AustinHarris.JsonRpc, Version=1.1.70.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?
Do we have support for Xamarin android?
The text was updated successfully, but these errors were encountered: