Android try catch JSON::parse

I have a little problem with JSON::parse(…) in Android. When the json file is invalid, the application is crashing. In Windows, iOS and MacOS is Ok, I don´t have this same problem.

Result result = JSON::parse(jsonString, jsonData);

For some reason, my local json file was corrupted. And now when the app is opening, it’s crashing because off this JSON::parse(). I expected that parse return “result.wasOk() == false”, not a throw exception. That because the parse function, already handle it.

I know that problem probally is not with JUCE, i belive it’s some ndk flag that i forgot to set. I try to set -fexceptions and -frtti, but does not worked.

I tested some try catch’s and, in Android, only default “catch (…)” does work.

try
{
throw 404;
}
catch (int ex)
{
DBG(ex);
}
catch (…)
{
DBG(“Defautl catch…”);
}

Can anyone help me with this?

Maybe I found the problem. My project uses a lib compiled with gcc and the project uses clang NDK Toolchain.

To test, I created a new GUI Application and test a lot of try catches, and every thing was ok.

When I setup the lib compiled using gcc, the new project does not catched the exceptions again.