Retrofit native crash Fatal signal 11 (SIGSEGV)

I spend few hours for debugging and find that problem in List. Retrofit cannot correctly deserialize my JSON and convert it to java object.

In Volley I used my own class ActionDeserialize<T> implements JsonDeserializer<T> where I implement class resolving according to class:

private Type getTypeForType(BTypes bType) {
    return bType.getResponseClass();
}

More details about this here

So, I resolve my problem with setting new GsonConverter (after blog reading):

    Gson gson = new GsonBuilder()
            .registerTypeAdapter(BaseActionPOJO.class, new ActionDeserialize<BaseActionPOJO>())
            .create();

    RestAdapter restAdapter = new RestAdapter.Builder()
            .setLogLevel(loglevel)
            .setConverter(new GsonConverter(gson))
            .setRequestInterceptor(requestInterceptor)
            .setEndpoint(Urls.BASE_URL)
            .setClient(new OkClient())
            .build();

And it resolve native crash in native part. I hope it will save your time.


Add these two lines to your build.gradle in the android section:

android{
    compileOptions {
            sourceCompatibility 1.8
            targetCompatibility 1.8
        }
}