Skip to content
This repository has been archived by the owner on Oct 6, 2023. It is now read-only.

No compilation errors but JSONSerialze generated data returns BadRequest status code in Android #146

Open
apar945 opened this issue Mar 3, 2022 · 2 comments

Comments

@apar945
Copy link

apar945 commented Mar 3, 2022

Hello,

I have read through the documentation, tried AOT "preserve-all" method, reviewed many open/closed tickets. However, my unity application does not work when compiled with IL2CPP scripting backend. We use Json for exchange data via APIs running in an AWS backend. When compiled with Mono, they work fine. But Google Play requires Armv64 support in your build to be allowed to publish the app. So we compiled a version with IL2CPP and there were no compile time issues. However, the Newtonsoft.Json dependent code does not work properly. I have tried version 13.0.102 of the release.

What could I try to get this to work? Any suggestions would be appreciated.

Regards
Ankit

@applejag
Copy link
Owner

applejag commented Mar 3, 2022

Hello @apar945! Nice of you to have tried reading up, that is such a great start!

Could you possibly get the error logs from the android build? It can sometimes be tricky, but making a development build should be a good start. Then the errors should be shown on screen and on connected PC inside Unity I believe.

If you could also provide the C# code and class used to serialize or deserialize then that'd be awesome. :) So I know which edge cases you might be hitting on.

@apar945
Copy link
Author

apar945 commented Mar 7, 2022

Hello @jilleJr
I was using a DLL which was referring to Newtonsoft.Json dll. I brought the code for the dll into the project and then tried serialising the data and calling the API and it all worked. So it seems like loading the json calls from another DLL, built in .Net targeting .Net Standard 2.0, was not working.
I will now test all areas of the application which use this call to confirm if functionality is broken.

Update: I just checked that I have been testing with unity newtonsoft package 3.0.1 today so that has been working and I am sure your package would also work as the unity package is fork of it.

Regards
Ankit

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants