0

i made android native app

RetrofitClient.getApiService().getUser().enqueue(new Callback<List<UserModel>>() {
        @Override
        public void onResponse(Call<List<UserModel>> call, Response<List<UserModel>> response) {
            if (response.isSuccessful()) {
                // if debug mode everything no error

                // but release mode
                // response.body() > is not null
                // response.body().getSomething() > is null

                // error message: throw with null exception
            }
        }

        @Override
        public void onFailure(Call<List<UserModel>> call, Throwable t) {

        }
    });

i have problem like this. when debug mode, everything is good. no error. but only release mode have error. i don't know what i have to do..

The models are as follows:

public class UserModel {
    @SerializedName("pages")
    @Expose
    private int pages;

    @SerializedName("posts")
    @Expose
    private List<PostModelView> posts;

    public int getPages() {
        return pages;
    }

    public void setPages(int pages) {
        this.pages = pages;
    }

    public List<PostModelView> getPosts() {
        return posts;
    }

    public void setPosts(List<PostModelView> posts) {
        this.posts = posts;
    }
}

(also no error when debug mode)

StarCue
  • 63
  • 9
  • If there is different behaviour between **debug** and **release** App, one possible reason could be related to **proguard** setting. Check [this](https://stackoverflow.com/questions/28701650/app-crashes-in-release-mode-only-how-to-configure-proguard) for a similar case. – Enowneb Jan 22 '23 at 07:42

0 Answers0