• Flutter: Unsupported value: false/true


    在使用FlutterBoost传参时,直接传递bool值时出现崩溃。

    1. FlutterBoost.singleton.open(
    2. 'flutter://personnel_page',
    3. urlParams: <String, dynamic>{
    4. 'isBd': i%2==0 ? true : false,
    5. },
    6. ),

    崩溃日志如下: 

     Caused by: java.lang.IllegalArgumentException: Unsupported value: false
            at io.flutter.plugin.common.StandardMessageCodec.writeValue(StandardMessageCodec.java:278)
            at io.flutter.plugin.common.StandardMessageCodec.writeValue(StandardMessageCodec.java:275)
            at io.flutter.plugin.common.StandardMessageCodec.writeValue(StandardMessageCodec.java:275)
            at io.flutter.plugin.common.StandardMethodCodec.encodeMethodCall(StandardMethodCodec.java:38)
            at io.flutter.plugin.common.MethodChannel.invokeMethod(MethodChannel.java:99)
            at com.idlefish.flutterboost.FlutterBoostPlugin.invokeMethod(FlutterBoostPlugin.java:138)
            at com.idlefish.flutterboost.FlutterBoostPlugin.invokeMethodUnsafe(FlutterBoostPlugin.java:96)
            at com.idlefish.flutterboost.ContainerRecord$MethodChannelProxy.invokeChannelUnsafe(ContainerRecord.java:292)
            at com.idlefish.flutterboost.ContainerRecord$MethodChannelProxy.create(ContainerRecord.java:231)
            at com.idlefish.flutterboost.ContainerRecord$MethodChannelProxy.access$100(ContainerRecord.java:226)
            at com.idlefish.flutterboost.ContainerRecord.onCreate(ContainerRecord.java:106)
            at com.idlefish.flutterboost.containers.FlutterActivityAndFragmentDelegate.onCreateView(FlutterActivityAndFragmentDelegate.java:163)
            at com.idlefish.flutterboost.containers.BoostFlutterActivity.createFlutterView(BoostFlutterActivity.java:229)
            at com.idlefish.flutterboost.containers.BoostFlutterActivity.onCreate(BoostFlutterActivity.java:149)
            at com.xx.ss.SSFlutterActivity.onCreate(SSFlutterActivity.java:32)
            at android.app.Activity.performCreate(Activity.java:8142)
            at android.app.Activity.performCreate(Activity.java:8114)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1308)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3550)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3749) 
            at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85) 
            at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) 
            at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) 
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2181) 
            ......

    原以为是FlutterBoost框架的bug,百度了一番,原来是低版本flutter的bug。

    这个是因为StandardMessageCodec的boolean检查有问题导致Native像Flutter传参map里value有boolean的时候崩溃,commit已经merge到master了

    https://github.com/flutter/engine/commit/13453596424988afa5eebafb5511b0bacbab19ae

    高版本还没有验证...

  • 相关阅读:
    腾讯开源业界首个云原生标准的一站式微服务管理框架Femas
    微信小程序 API 简介
    HCIA---静态路由扩展配置
    mac安装nvm
    时间管理类书籍阅读笔记
    线扫相机DALSA--常见问题四:修改相机参数,参数保存无效情况
    区间素数 马蹄集
    代码随想录49——动态规划:121买卖股票的最佳时机、122买卖股票的最佳时机II
    A股-股票程序自动化交易接口
    2023一建《建筑》真题答案及解析--完整版
  • 原文地址:https://blog.csdn.net/jdsjlzx/article/details/125415560