API Calls works with Mono but not with IL2CPP

Hello,

I was developing an application on my mobile, with Mono. But I wanted to test it on another phone, and the application could not be installed. I realised that I needed to do a build in 64bits, and therefore necessarily in IL2CPP. I’m using Unity 2022.3.31f1. But API calls with IL2CPP doesn’t work, while working perfectly with mono.

I’m not getting any errors, the app just hangs at this line when running on a OnePlus 8 or Google Pixel :
ApiResourceList pkmns = await pokeClient.GetApiResourceAsync(filter) ;

I have a Debug.Log statement before and after this line and when IL2CPP is selected, the Debug.Log is never called after the line above.

I saw that there were known issues in 2019. Have they been resolved? I can’t find a solution.

The application works perfectly with Mono. The only change I am making is to change the drop down list to IL2CPP.
Here’s the build setting :

If you have any solutions for this problem, I’d be happy to take them.
Thanks in advance!

where is the api? the options have download over http not enabled, if the api is http based then it would fail.

I don’t know, I use a SDK provided by this : Developer Portal | Pokémon TCG API

This parameter doesn’t change anytinhg :frowning:

When you say this:

…are you actually looking at the runtime logs? It’s rare not to see some kind of complaint such as an exception being thrown. It does happen though.

The Mono vs IL2CPP thing makes me think that perhaps your code uses something that isn’t implemented in IL2CPP, such as the entire System.Diagnostic.Process class and probably a few other things.

Mmmmh not really. i don’t know how and where can I see runtime logs while testing on an built apk on my phone. Because it works on my unity editor, so I can’t reproduce the problem in my development environment.

You should check out Google! :slight_smile:

You want the adb utility and a wire and the adb command is logcat

There’s even a Unity integration to pipe it into your console window.

Thanks for the advice :slight_smile:
Indeed I have a problem during the API call, “the operation is not supported by the platform”

I don’t know how to bypass it…