Closed zuijinbuzai closed 7 years ago
sorry, I found the wrong place, It should be sdk use the AsyncTask SerialExecutor blocked for a long time. if I delete the sdk, It is ok in the place lib use AsyncTask not blocked.
Hey @zuijinbuzai, thanks for reporting this issue, could you provide more information about the Android API version where you are experiencing it please? That will help us narrow it down. Thank you!
@fransanchez I'm in China,the AsyncTask will blocked by the network for a long time no response, if open vpn, it will be ok. version 4.4, 6.0 and some more, almost all deveices will blocked. so I fixed it by add this code
private void fuckAsyncTask() {
//Fix UCrop BitmapLoadTask blocked by fb network
try {
Field nameField = AsyncTask.class.getDeclaredField("sDefaultExecutor");
nameField.setAccessible(true);
nameField.set(new AsyncTask<Void, Void, Void>() {
@Override
protected Void doInBackground(Void... params) {
return null;
}
}, Executors.newCachedThreadPool());
} catch (NoSuchFieldException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
com.facebook.android:audience-network-sdk:4.23.0 AudienceNetworkActivity var3.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, new String[]{var1}); It will blocked the Other lib who used AsyncTask, pls fix it.