Мое приложение работает нормально почти на всех устройствах, но некоторые клиенты ответили, что приложение не открывается. Я никогда не видел, чтобы на одном и том же приложении ломалось настоящее устройство. В магазине Play показаны некоторые отчеты cra sh, и он включает в себя почти все типы моделей устройств, но большинство из них были устройствами huawei ..
java.lang.NullPointerException:
at www.ourshopee.com.fragment.TabDealOfDayFragment$2.onResponse (TabDealOfDayFragment.java:189)
at retrofit2.ExecutorCallAdapterFactory$ExecutorCallbackCall$1$1.run (ExecutorCallAdapterFactory.java:65)
at android.os.Handler.handleCallback (Handler.java:789)
at android.os.Handler.dispatchMessage (Handler.java:98)
at android.os.Looper.loop (Looper.java:164)
at android.app.ActivityThread.main (ActivityThread.java:6940)
at java.lang.reflect.Method.invoke (Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:327)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1374)
Я получаю эту ошибку в игровой консоли, но я работаю во всех мое тестирующее устройство.
implementation 'com.squareup.okhttp3:okhttp:3.0.0-RC1'
implementation 'com.squareup.okhttp3:logging-interceptor:3.0.0-RC1'
implementation 'com.squareup.retrofit2:converter-gson:2.0.0-beta3'
implementation 'com.squareup.retrofit2:retrofit:2.0.0-beta3'
Пожалуйста, помогите мне, ваша помощь будет оценена ..
TabDealFragment
private void getProductsFromServer() {
if (AppUtils.isConnectedToInternet(getContext(), true)) {
llErrorLayout.setVisibility(View.INVISIBLE);
Callback<DealOfDayResponse> callback = new Callback<DealOfDayResponse>() {
@Override
public void onResponse(Response<DealOfDayResponse> response) {
progress_deals.setVisibility(View.INVISIBLE);
if (response.body().getCode()==200) {
if (response.body().getData().getTempSection().size() != 0) {
dealOfDayList.addAll(response.body().getData().getTempSection());
dealproductListingAdapter.notifyDataSetChanged();
}
dealOfDayList.addAll(response.body().getData().getDealOfDay());
dealproductListingAdapter.notifyDataSetChanged();
llErrorLayout.setVisibility(View.INVISIBLE);
tvErrorText.setVisibility(View.INVISIBLE);
loading = true;
}
}
@Override
public void onFailure(Throwable t) {
Log.d("Whats_My_Crash", String.valueOf(t));
progress_deals.setVisibility(View.INVISIBLE);
llErrorLayout.setVisibility(View.VISIBLE);
tvErrorText.setText(getString(R.string.err_unexpected));
}
};
ApiManager.getApi().getService().getDealOfDayProducts(Constants.GET_DEALS_PRODUCTS, AppUtils.getCountryCode(getContext()), page, SUBCATEGORY_ID, BRAND_ID).enqueue(callback);
loading = true;
} else {
llErrorLayout.setVisibility(View.VISIBLE);
tvErrorText.setText(getString(R.string.err_internet));
}
}