java - OkHTTP3 in Android -


i use okhttp3 in android studio 2.2.3 on simple project. project run on emulator (nexus 5 android 7 api 24) without problem in phones (lg k10 android 6 api 23) , (huawei honor 4x api 19) crashed , has stopped. use okhttp3 package com.squareup.okhttp3:okhttp:3.4.1 in project module:app is->

(compilesdkversion 25 buildtoolsversion "25.0.1" defaultconfig { applicationid "android.hrsh.okhttpv2" minsdkversion 15 targetsdkversion 25)

my code is:

    okhttpclient client = new okhttpclient();     request request = new request.builder()             .url("http://www.imodares.ir/json-url/imodares-json.html")             .build();     callback callback = new callback() {...}   try {         client.newcall(request).enqueue(callback);      }     catch (exception e ){label.settext(e.getmessage());} 

i test code

 client.newcall(request).execute(); 

but same result please guide me thanks

is possible test debug apk on emulator , release 1 on phone? if is, proguard might problem.


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -