【问题标题】:Android: Volley Timeout crash FixAndroid:排球超时崩溃修复
【发布时间】:2015-06-07 07:19:24
【问题描述】:

我的应用程序因 com.android.volley.TimeoutError 而崩溃(偶尔)。 您可以在下面看到 stack_trace 和 logcat 输出。

我已经有如下错误处理函数:

private Response.ErrorListener volleyErrorListener = new Response.ErrorListener({
    @Override
    public void onErrorResponse(VolleyError e) {
        stopLoader();
        showToast(Constant.ERROR);
    }
};

(我认为这将处理所有事件,如超时、无连接等)

  1. 能否解释一下为什么会这样?
  2. 如何防止我的应用程序崩溃? (任何示例代码将不胜感激)

提前致谢!

ANDROID_VERSION=4.3
PHONE_MODEL=GT-I9300

STACK_TRACE

com.android.volley.TimeoutError
at com.android.volley.toolbox.BasicNetwork.performRequest(BasicNetwork.java:123)
at com.android.volley.NetworkDispatcher.run(NetworkDispatcher.java:110)

LOGCAT

04-02 18:11:18.405 I/dalvikvm(21976): Could not find method com.google.inject.Injector.getTypeConverterBindings, referenced from method roboguice.inject.ContextScopedRoboInjector.getTypeConverterBindings
04-02 18:11:18.405 W/dalvikvm(21976): VFY: unable to resolve interface method 27646: Lcom/google/inject/Injector;.getTypeConverterBindings ()Ljava/util/Set;
04-02 18:11:18.405 D/dalvikvm(21976): VFY: replacing opcode 0x72 at 0x000c
04-02 18:11:18.560 D/dalvikvm(21976): GC_CONCURRENT freed 884K, 18% free 9573K/11636K, paused 5ms+2ms, total 29ms
04-02 18:11:18.560 D/dalvikvm(21976): WAIT_FOR_CONCURRENT_GC blocked 12ms
04-02 18:11:18.655 D/dalvikvm(21976): GC_CONCURRENT freed 932K, 18% free 9647K/11760K, paused 2ms+9ms, total 28ms
04-02 18:11:18.715 D//Ln.java:218(21976): main Configuring Logging, minimum log level is INFO
04-02 18:11:18.850 I/System.out(21976): Logged In-> null
04-02 18:11:18.880 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:18.885 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:18.885 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:18.890 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:18.935 D/libEGL  (21976): loaded /system/lib/egl/libEGL_mali.so
04-02 18:11:18.945 D/libEGL  (21976): loaded /system/lib/egl/libGLESv1_CM_mali.so
04-02 18:11:18.950 D/libEGL  (21976): loaded /system/lib/egl/libGLESv2_mali.so
04-02 18:11:18.960 E/        (21976): Device driver API match
04-02 18:11:18.960 E/        (21976): Device driver API version: 23
04-02 18:11:18.960 E/        (21976): User space API version: 23 
04-02 18:11:18.960 E/        (21976): mali: REVISION=Linux-r3p2-01rel3 BUILD_DATE=Wed Oct  9 21:05:57 KST 2013 
04-02 18:11:19.065 D/OpenGLRenderer(21976): Enabling debug mode 0
04-02 18:11:19.090 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:19.090 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:19.090 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:19.095 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:27.845 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:27.850 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:28.255 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:28.255 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:28.750 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:28.755 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:29.770 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:29.775 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:30.260 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:30.260 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:30.675 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:30.680 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:31.020 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:31.020 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:31.180 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:31.185 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:33.500 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:33.500 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:34.640 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:36.705 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:36.755 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:37.140 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:37.140 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:37.610 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:37.615 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:37.885 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:37.885 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:37.925 D/dalvikvm(21976): GC_CONCURRENT freed 1226K, 20% free 9832K/12240K, paused 6ms+2ms, total 32ms
04-02 18:11:38.370 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:38.375 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:38.925 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:39.200 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:39.245 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:39.450 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:39.455 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:39.845 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:39.850 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:42.355 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:42.360 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:42.395 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:42.685 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:42.685 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:42.685 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:42.710 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:43.070 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:43.070 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:43.070 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:43.095 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:43.445 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:43.445 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:43.445 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:43.480 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:43.840 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:43.840 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:43.840 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:43.885 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:44.225 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:44.225 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:44.230 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:44.260 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:44.830 D/ProgressBar(21976): setProgress = 0
04-02 18:11:44.830 D/ProgressBar(21976): setProgress = 0, fromUser = false
04-02 18:11:44.830 D/ProgressBar(21976): mProgress = 0mIndeterminate = false, mMin = 0, mMax = 10000
04-02 18:11:44.875 D/dalvikvm(21976): GC_FOR_ALLOC freed 78K, 19% free 9969K/12240K, paused 18ms, total 19ms
04-02 18:11:44.875 I/dalvikvm-heap(21976): Grow heap (frag case) to 11.960MB for 1127536-byte allocation
04-02 18:11:44.895 D/dalvikvm(21976): GC_CONCURRENT freed 1K, 18% free 11068K/13344K, paused 3ms+2ms, total 20ms
04-02 18:11:44.895 D/dalvikvm(21976): WAIT_FOR_CONCURRENT_GC blocked 10ms
04-02 18:11:44.895 D/dalvikvm(21976): WAIT_FOR_CONCURRENT_GC blocked 18ms
04-02 18:11:44.960 D/ProgressBar(21976): updateDrawableBounds: left = 0
04-02 18:11:44.960 D/ProgressBar(21976): updateDrawableBounds: top = 0
04-02 18:11:44.960 D/ProgressBar(21976): updateDrawableBounds: right = 96
04-02 18:11:44.960 D/ProgressBar(21976): updateDrawableBounds: bottom = 96
04-02 18:11:45.745 D/TextLayoutCache(21976): Enable myanmar Zawgyi converter
04-02 18:11:55.635 D/ACRA    (21976): Using custom Report Fields
04-02 18:11:55.675 I/ACRA    (21976): READ_LOGS granted! ACRA can include LogCat and DropBox data.
04-02 18:11:55.695 D/ACRA    (21976): Retrieving logcat output...

【问题讨论】:

    标签: android timeout android-volley connection-timeout acra


    【解决方案1】:

    当我开始使用volley时,我遇到了同样的问题,我从link下载了volley,后来我意识到这不是官方源代码,它是EDITED 一个,本源代码的编辑根据自己的需求定制了官方源代码。 然后我从official google account 下载了volley 的实际来源,我与volley 相关的所有问题现在都已修复。 所以从official google account下载官方源代码。

    【讨论】:

    • 如果您在下载过程中遇到任何困难,请告诉我,我会将库的jar文件发送给您。
    • 感谢 kashif181。如何下载 .jar 文件?有没有没有 git clone 的直接链接?
    • 你可以直接从这个链接android.googlesource.com/platform/frameworks/volley/+/master下载源代码,点击这个链接上的tgz。然后制作jar文件(通过制作库项目)。否则,您可以从我的下拉框中下载 jar 文件,这是链接 dropbox.com/s/cl299js7yr0faz8/volleylib.jar?dl=0
    • 这是正确答案,谢谢kashift181,你帮了我很多!
    猜你喜欢
    • 2018-05-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-10-07
    • 2018-01-18
    相关资源
    最近更新 更多