android Volley library NegativeArraySizeException

匿名 (未验证) 提交于 2019-12-03 01:34:02

问题:

I'm getting this NegativeArraySizeException from Volley library. This error started after I changed Volley android-library-module to a maven dependencies like compile 'com.android.volley:volley:1.0.0'

I've this singleton pattern and I change the addToRequestQueue method to avoid double request bug with following link:

public <T> void addToRequestQueue(Request<T> req) {         req.setRetryPolicy(new DefaultRetryPolicy(                 0,                 DefaultRetryPolicy.DEFAULT_MAX_RETRIES,                 DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));         getRequestQueue().add(req);     } 

I see that official Android-Volley does not getting any updates. So Do I have to change it back what it was? Or is there any way to fix this bug? Thanks in advance.

Fatal Exception: java.lang.NegativeArraySizeException: -603989761        at com.android.volley.toolbox.DiskBasedCache.streamToBytes(DiskBasedCache.java:323)        at com.android.volley.toolbox.DiskBasedCache.readString(DiskBasedCache.java:541)        at com.android.volley.toolbox.DiskBasedCache.readStringStringMap(DiskBasedCache.java:563)        at com.android.volley.toolbox.DiskBasedCache$CacheHeader.readHeader(DiskBasedCache.java:404)        at com.android.volley.toolbox.DiskBasedCache.initialize(DiskBasedCache.java:157)        at com.android.volley.CacheDispatcher.run(CacheDispatcher.java:84) 
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!