title: android volley and asynchttpclient failed on real device but worked on emulator
body: <p>hello every one I just make an android app that using ICS_OPENVPN library but when I make SplashActivity to check for update app worked Currect on emulator but when I generate for signed APK and install it on real device it is not switch to MainActivity.</p>
  <p>SplashActivity.java</p>
  <pre><code>package com.orangevpninfo.orangevpn;
  
  import androidx.annotation.NonNull;
  import androidx.appcompat.app.AlertDialog;
  import androidx.appcompat.app.AppCompatActivity;
  import android.content.Context;
  import android.content.DialogInterface;
  import android.content.Intent;
  import android.net.Uri;
  import android.os.Bundle;
  import android.util.Log;
  import android.view.View;
  import android.view.animation.Animation;
  import android.view.animation.AnimationUtils;
  import android.widget.Toast;
  import com.airbnb.lottie.LottieAnimationView;
  import com.android.volley.NetworkResponse;
  import com.android.volley.Request;
  import com.android.volley.RequestQueue;
  import com.android.volley.Response;
  import com.android.volley.VolleyError;
  import com.android.volley.toolbox.JsonObjectRequest;
  import com.android.volley.toolbox.JsonRequest;
  import com.android.volley.toolbox.Volley;
  import com.google.android.gms.tasks.OnCompleteListener;
  import com.google.android.gms.tasks.Task;
  import com.google.firebase.iid.FirebaseInstanceId;
  import com.google.firebase.iid.InstanceIdResult;
  import com.google.gson.Gson;
  import com.google.gson.JsonObject;
  import com.loopj.android.http.AsyncHttpClient;
  import com.loopj.android.http.JsonHttpResponseHandler;
  import com.orangevpninfo.orangevpn.models.Version;
  import cz.msebera.android.httpclient.Header;
  import org.json.JSONArray;
  import org.json.JSONObject;
  
  public class SplashActivity extends AppCompatActivity {
  
      LottieAnimationView la_animation;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_splash);
          la_animation=findViewById(R.id.la_animation2);
          startAnimation(SplashActivity.this, R.id.la_animation2, R.anim.fade_in_1000, true);
          la_animation.cancelAnimation();
          la_animation.setAnimation(R.raw.loading2);
          la_animation.playAnimation();
  
  
          checkupdate2(&quot;1&quot;);
  
  
  
  
      }
      private void download(final String Link){
          AlertDialog alertDialog = new AlertDialog.Builder(SplashActivity.this).create();
          alertDialog.setTitle(&quot;New Version Available&quot;);
          alertDialog.setMessage(&quot;There is a New version of this App! Please select Update to Download directly new version and install it&quot;);
          alertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, &quot;Not Now&quot;,
                  new DialogInterface.OnClickListener() {
                      public void onClick(DialogInterface dialog, int which) {
                          dialog.dismiss();
                          finish();
                      }
                  });
          alertDialog.setButton(AlertDialog.BUTTON_POSITIVE, &quot;Update&quot;,
                  new DialogInterface.OnClickListener() {
                      public void onClick(DialogInterface dialog, int which) {
                          Intent a=new Intent(Intent.ACTION_VIEW, Uri.parse(Link));
                          startActivity(a);
                          finish();
                      }
                  });
          alertDialog.show();
          //Intent i = new Intent(Intent.ACTION_VIEW);
          //i.setData(Uri.parse(Link));
          //startActivity(i);
      }
  
      private void checkupdate2(final String version){
  
  
          Request&lt;JSONObject&gt; jsonObjectRequest = new JsonObjectRequest(Request.Method.GET, &quot;http://51.89.45.117/version/version.json&quot;,
                  null, new Response.Listener&lt;JSONObject&gt;() {
              @Override
              public void onResponse(JSONObject response) {
                  Log.d(&quot;Success&quot;, response.toString());
                  Version ver=new Gson().fromJson(response.toString(), Version.class);
                  if (ver.getVersion().equals(version)){
                      Intent a=new Intent(SplashActivity.this,MainActivity.class);
                      startActivity(a);
                      finish();
  
                  }else{
                      download(ver.getLink());
                  }
              }
          }, new Response.ErrorListener() {
              @Override
              public void onErrorResponse(VolleyError error) {
                  Log.d(&quot;Error&quot;, error.toString());
  
              }
  
          });
          RequestQueue requestQueue = Volley.newRequestQueue(getApplicationContext());
           requestQueue.add(jsonObjectRequest);
  
      }
      private void checkupdate(final String version){
          String url=&quot;http://51.89.45.117/version/version.json&quot;;
          AsyncHttpClient client = new AsyncHttpClient();
          client.setConnectTimeout(30);
          client.get(this,url,new JsonHttpResponseHandler(){
              @Override
              public void onSuccess(int statusCode, Header[] headers, JSONArray response) {
                  super.onSuccess(statusCode, headers, response);
  
                  Version[] ver=new Gson().fromJson(response.toString(), Version[].class);
                  if (ver[0].getVersion().equals(version)){
                      Intent a=new Intent(SplashActivity.this,MainActivity.class);
                      startActivity(a);
                      finish();
  
                  }else{
  
                      download(ver[0].getLink());
                  }
  
              }
  
              @Override
              public void onSuccess(int statusCode, Header[] headers, JSONObject response) {
                  super.onSuccess(statusCode, headers, response);
                  Version ver=new Gson().fromJson(response.toString(), Version.class);
                  if (ver.getVersion().equals(version)){
                      Intent a=new Intent(SplashActivity.this,MainActivity.class);
                      startActivity(a);
                      finish();
  
                  }else{
                      download(ver.getLink());
                  }
              }
  
              @Override
              public void onFailure(int statusCode, Header[] headers, Throwable throwable, JSONArray errorResponse) {
                  super.onFailure(statusCode, headers, throwable, errorResponse);
  
                  Version[] ver=new Gson().fromJson(errorResponse.toString(), Version[].class);
                  if (ver[0].getVersion().equals(version)){
                      Intent a=new Intent(SplashActivity.this,MainActivity.class);
                      startActivity(a);
                      finish();
  
                  }else{
  
                      download(ver[0].getLink());
                  }
  
              }
  
              @Override
              public void onFailure(int statusCode, Header[] headers, Throwable throwable, JSONObject errorResponse) {
                  super.onFailure(statusCode, headers, throwable, errorResponse);
                  Toast.makeText(SplashActivity.this, &quot;success Jobj&quot;, Toast.LENGTH_SHORT).show();
                  Version ver=new Gson().fromJson(errorResponse.toString(), Version.class);
                  if (ver.getVersion().equals(version)){
                      Intent a=new Intent(SplashActivity.this,MainActivity.class);
                      startActivity(a);
                      SplashActivity.this.finish();
  
                  }else{
                      download(ver.getLink());
                  }
  
              }
  
              @Override
              public void onFailure(int statusCode, Header[] headers, String responseString, Throwable throwable) {
                  super.onFailure(statusCode, headers, responseString, throwable);
                  Intent a=new Intent(SplashActivity.this,MainActivity.class);
                  startActivity(a);
                  SplashActivity.this.finish();
              }
  
              @Override
              public void onSuccess(int statusCode, Header[] headers, String responseString) {
                  super.onSuccess(statusCode, headers, responseString);
                  Intent a=new Intent(SplashActivity.this,MainActivity.class);
                  startActivity(a);
                  SplashActivity.this.finish();
              }
          });
      }
      public void startAnimation(Context ctx, int view, int animation, boolean show) {
          final View Element = findViewById(view);
          if (show) {
              Element.setVisibility(View.VISIBLE);
          } else {
              Element.setVisibility(View.INVISIBLE);
          }
          Animation anim = AnimationUtils.loadAnimation(ctx, animation);
          Element.startAnimation(anim);
      }
  }
  
  
  </code></pre>
  <p>Volley error in Crashlytics</p>
  <pre><code>Fatal Exception: java.lang.NullPointerException
  Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference
  com.orangevpninfo.orangevpn.SplashActivity$3.onResponse (SplashActivity.java:17)
  com.android.volley.toolbox.JsonRequest.deliverResponse (JsonRequest.java:17)
  com.android.volley.ExecutorDelivery$ResponseDeliveryRunnable.run (ExecutorDelivery.java:2)
  android.os.Handler.handleCallback (Handler.java:751)
  android.os.Handler.dispatchMessage (Handler.java:95)
  android.os.Looper.loop (Looper.java:154)
  android.app.ActivityThread.main (ActivityThread.java:6138)
  java.lang.reflect.Method.invoke (Method.java)
  com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:893)
  com.android.internal.os.ZygoteInit.main (ZygoteInit.java:783)
  </code></pre>
  <p>AsyncHttpClient error Crashlytics</p>
  <pre><code>Fatal Exception: java.lang.RuntimeException
  java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String org.json.JSONObject.toString()' on a null object reference
  com.loopj.android.http.AsyncHttpResponseHandler.onUserException (AsyncHttpResponseHandler.java:28)
  com.loopj.android.http.AsyncHttpResponseHandler$ResponderHandler.handleMessage (AsyncHttpResponseHandler.java)
  android.os.Handler.dispatchMessage (Handler.java:102)
  android.os.Looper.loop (Looper.java:154)
  android.app.ActivityThread.main (ActivityThread.java:6138)
  java.lang.reflect.Method.invoke (Method.java)
  com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:893)
  com.android.internal.os.ZygoteInit.main (ZygoteInit.java:783)
  </code></pre>
  <pre><code>Caused by java.lang.NullPointerException
  Attempt to invoke virtual method 'java.lang.String org.json.JSONObject.toString()' on a null object reference
  com.orangevpninfo.orangevpn.SplashActivity$4.onFailure (SplashActivity.java)
  com.loopj.android.http.JsonHttpResponseHandler.onFailure (JsonHttpResponseHandler.java:19)
  com.loopj.android.http.AsyncHttpResponseHandler.handleMessage (AsyncHttpResponseHandler.java:19)
  com.loopj.android.http.AsyncHttpResponseHandler$ResponderHandler.handleMessage (AsyncHttpResponseHandler.java)
  android.os.Handler.dispatchMessage (Handler.java:102)
  android.os.Looper.loop (Looper.java:154)
  android.app.ActivityThread.main (ActivityThread.java:6138)
  java.lang.reflect.Method.invoke (Method.java)
  com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:893)
  com.android.internal.os.ZygoteInit.main (ZygoteInit.java:783)
  </code></pre>