Reply already submitted io.flutter.embedding.engine.dart.DartMessenger$Reply.reply

flutter 异常闪退,报下面的错误,这是因为

 Result 对象 重复使用造成的,result.success()或者result.error()只能使用一次,只用一次之后,result就失效了,如果再次使用result上报结果就会报下面的异常

 

java.lang.IllegalStateException: Reply already submitted
        at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:135)
        at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.success(MethodChannel.java:225)
        at com.xxx.MainActivity$1$1.onGetWeatherSuccess(MainActivity.java:166)
        at com.xxx.xxx.xxx$3.onResponse(WeatherPst.java:106)
        at com.android.volley.toolbox.JsonRequest.deliverResponse(JsonRequest.java:72)
        at com.android.volley.ExecutorDelivery$ResponseDeliveryRunnable.run(ExecutorDelivery.java:99)
        at android.os.Handler.handleCallback(Handler.java:907)
        at android.os.Handler.dispatchMessage(Handler.java:105)
        at android.os.Looper.loop(Looper.java:216)
        at android.app.ActivityThread.main(ActivityThread.java:7625)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)

 

你可能感兴趣的:(Flutter,异常)