清泛IT社区App Inventor 2 中文社区

搜索

扫码访问移动社区 移动社区,您的掌上技术专家

关注我,精彩不错过! 关注我,精彩不错过!

扫码安装最新版AI伴侣 最新版AI伴侣v2.76

Aia StoreApp上架指南 .aia 源码一站式解决方案 发布日志AI2连接测试ai2Starter模拟器

AppInventor2离线版中文教育版接入DeepSeek VIP会员 享专有教程,免费赠送基础版*技术支持服务! AI2入门必读中文文档AI2拓展IoT专题

打印 上一主题 下一主题

[解决中] 嵌套块验证失败:未知的代码块类型: procedures_ifreturn,已拒绝添加

  • TA的每日心情
    开心
    昨天 06:46
  • 签到天数: 741 天

    [LV.9]以坛为家II

    1050

    主题

    1735

    帖子

    4万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    积分
    49802

    AI2中文网VIP弹球达人接水果达人撸猫达人

    11#
    发表于 5 天前 | 只看该作者
    ✓ 代码块已整理  但是没有效果
    App Inventor 2 中文网 - MIT同步更新的中文本土化平台!v2.76 支持Android 15 & iOS 更新日志
  • TA的每日心情
    开心
    昨天 06:46
  • 签到天数: 741 天

    [LV.9]以坛为家II

    1050

    主题

    1735

    帖子

    4万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    积分
    49802

    AI2中文网VIP弹球达人接水果达人撸猫达人

    12#
    发表于 4 天前 | 只看该作者
    ❌ 失败 1 项:
    • 代码块添加失败,工作区已恢复: Cannot read properties of undefined (reading 'length')[
      {
        "action": "ADD_BLOCK",
        "xml": "<block type=\"procedures_defreturn\" x=\"20\" y=\"20\"><mutation><arg name=\"maxValue\"></arg><arg name=\"rollTimes\"></arg></mutation><field name=\"NAME\">模拟多次掷骰</field><comment pinned=\"false\" h=\"80\" w=\"160\">模拟多次掷骰,返回统计结果</comment><statement name=\"STACK\"><block type=\"local_declaration_statement\"><field name=\"VAR\">result</field><value name=\"VALUE\"><block type=\"text\"><field name=\"TEXT\"></field></block></value><next><block type=\"local_declaration_statement\"><field name=\"VAR\">total</field><value name=\"VALUE\"><block type=\"math_number\"><field name=\"NUM\">0</field></block></value><next><block type=\"local_declaration_statement\"><field name=\"VAR\">count</field><value name=\"VALUE\"><block type=\"math_number\"><field name=\"NUM\">0</field></block></value><next><block type=\"local_declaration_statement\"><field name=\"VAR\">maxRoll</field><value name=\"VALUE\"><block type=\"math_number\"><field name=\"NUM\">0</field></block></value><next><block type=\"local_declaration_statement\"><field name=\"VAR\">minRoll</field><value name=\"VALUE\"><block type=\"lexical_variable_get\"><field name=\"VAR\">maxValue</field></block></value><next><block type=\"controls_forRange\"><field name=\"VAR\">i</field><value name=\"FROM\"><block type=\"math_number\"><field name=\"NUM\">1</field></block></value><value name=\"TO\"><block type=\"lexical_variable_get\"><field name=\"VAR\">rollTimes</field></block></value><value name=\"STEP\"><block type=\"math_number\"><field name=\"NUM\">1</field></block></value><statement name=\"DO\"><block type=\"local_declaration_statement\"><field name=\"VAR\">currentRoll</field><value name=\"VALUE\"><block type=\"math_random_int\"><value name=\"FROM\"><block type=\"math_number\"><field name=\"NUM\">1</field></block></value><value name=\"TO\"><block type=\"lexical_variable_get\"><field name=\"VAR\">maxValue</field></block></value></block></value><next><block type=\"lexical_variable_set\"><field name=\"VAR\">total</field><value name=\"VALUE\"><block type=\"math_arithmetic\"><field name=\"OP\">ADD</field><value name=\"A\"><block type=\"lexical_variable_get\"><field name=\"VAR\">total</field></block></value><value name=\"B\"><block type=\"lexical_variable_get\"><field name=\"VAR\">currentRoll</field></block></value></block></value><next><block type=\"controls_if\"><mutation else=\"1\"></mutation><value name=\"IF0\"><block type=\"logic_compare\"><field name=\"OP\">GT</field><value name=\"A\"><block type=\"lexical_variable_get\"><field name=\"VAR\">currentRoll</field></block></value><value name=\"B\"><block type=\"lexical_variable_get\"><field name=\"VAR\">maxRoll</field></block></value></block></value><statement name=\"DO0\"><block type=\"lexical_variable_set\"><field name=\"VAR\">maxRoll</field><value name=\"VALUE\"><block type=\"lexical_variable_get\"><field name=\"VAR\">currentRoll</field></block></value></block></statement><value name=\"IF1\"><block type=\"logic_compare\"><field name=\"OP\">LT</field><value name=\"A\"><block type=\"lexical_variable_get\"><field name=\"VAR\">currentRoll</field></block></value><value name=\"B\"><block type=\"lexical_variable_get\"><field name=\"VAR\">minRoll</field></block></value></block></value><statement name=\"DO1\"><block type=\"lexical_variable_set\"><field name=\"VAR\">minRoll</field><value name=\"VALUE\"><block type=\"lexical_variable_get\"><field name=\"VAR\">currentRoll</field></block></value></block></statement><next><block type=\"controls_if\"><mutation else=\"1\"></mutation><value name=\"IF0\"><block type=\"logic_compare\"><field name=\"OP\">EQ</field><value name=\"A\"><block type=\"lexical_variable_get\"><field name=\"VAR\">currentRoll</field></block></value><value name=\"B\"><block type=\"lexical_variable_get\"><field name=\"VAR\">maxValue</field></block></value></block></value><statement name=\"DO0\"><block type=\"lexical_variable_set\"><field name=\"VAR\">count</field><value name=\"VALUE\"><block type=\"math_arithmetic\"><field name=\"OP\">ADD</field><value name=\"A\"><block type=\"lexical_variable_get\"><field name=\"VAR\">count</field></block></value><value name=\"B\"><block type=\"math_number\"><field name=\"NUM\">1</field></block></value></block></value></block></statement></block></next></block></next></block></next></block></statement><next><block type=\"lexical_variable_set\"><field name=\"VAR\">result</field><value name=\"VALUE\"><block type=\"text_join\"><mutation items=\"7\"></mutation><value name=\"ADD0\"><block type=\"text\"><field name=\"TEXT\">掷骰</field></block></value><value name=\"ADD1\"><block type=\"lexical_variable_get\"><field name=\"VAR\">rollTimes</field></block></value><value name=\"ADD2\"><block type=\"text\"><field name=\"TEXT\">次统计:\n总点数:</field></block></value><value name=\"ADD3\"><block type=\"lexical_variable_get\"><field name=\"VAR\">total</field></block></value><value name=\"ADD4\"><block type=\"text\"><field name=\"TEXT\">\n平均点数:</field></block></value><value name=\"ADD5\"><block type=\"math_arithmetic\"><field name=\"OP\">DIVIDE</field><value name=\"A\"><block type=\"lexical_variable_get\"><field name=\"VAR\">total</field></block></value><value name=\"B\"><block type=\"lexical_variable_get\"><field name=\"VAR\">rollTimes</field></block></value></block></value><value name=\"ADD6\"><block type=\"text_join\"><mutation items=\"5\"></mutation><value name=\"ADD0\"><block type=\"text\"><field name=\"TEXT\">\n最大值:</field></block></value><value name=\"ADD1\"><block type=\"lexical_variable_get\"><field name=\"VAR\">maxRoll</field></block></value><value name=\"ADD2\"><block type=\"text\"><field name=\"TEXT\">,最小值:</field></block></value><value name=\"ADD3\"><block type=\"lexical_variable_get\"><field name=\"VAR\">minRoll</field></block></value><value name=\"ADD4\"><block type=\"text_join\"><mutation items=\"2\"></mutation><value name=\"ADD0\"><block type=\"text\"><field name=\"TEXT\">\n掷出最大值次数:</field></block></value><value name=\"ADD1\"><block type=\"lexical_variable_get\"><field name=\"VAR\">count</field></block></value></block></value></block></value></block></value></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></statement><value name=\"RETURN\"><block type=\"lexical_variable_get\"><field name=\"VAR\">result</field></block></value></block>"
      },
      {
        "action": "ADD_BLOCK",
        "xml": "<block type=\"component_event\" x=\"20\" y=\"600\"><mutation component_type=\"Button\" is_generic=\"false\" instance_name=\"RollButton\" event_name=\"DoubleClick\"></mutation><field name=\"COMPONENT_SELECTOR\">RollButton</field><statement name=\"DO\"><block type=\"component_set_get\"><mutation component_type=\"Label\" set_or_get=\"set\" property_name=\"Text\" is_generic=\"false\" instance_name=\"ResultLabel\"></mutation><field name=\"COMPONENT_SELECTOR\">ResultLabel</field><field name=\"PROP\">Text</field><value name=\"VALUE\"><block type=\"procedures_callreturn\"><mutation name=\"模拟多次掷骰\"><arg name=\"maxValue\"></arg><arg name=\"rollTimes\"></arg></mutation><value name=\"ARG0\"><block type=\"math_number\"><field name=\"NUM\">6</field></block></value><value name=\"ARG1\"><block type=\"math_number\"><field name=\"NUM\">20</field></block></value></block></value></block></statement></block>"
      },
      {
        "action": "CLEANUP_BLOCKS"
      }
    ]


    App Inventor 2 中文网 - MIT同步更新的中文本土化平台!v2.76 支持Android 15 & iOS 更新日志
  • TA的每日心情
    开心
    昨天 06:46
  • 签到天数: 741 天

    [LV.9]以坛为家II

    1050

    主题

    1735

    帖子

    4万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    积分
    49802

    AI2中文网VIP弹球达人接水果达人撸猫达人

    13#
    发表于 4 天前 | 只看该作者
    {"$components":[{"$Name":"按钮1","$Type":"Button","$Version":"7","Text":"按钮1文本","Uuid":"673191802"}],"$blocks":["<xml><block xmlns=\"http://www.w3.org/1999/xhtml\" type=\"component_event\" id=\"94kD8o9tHFtfg-o3Hr8=\" x=\"353\" y=\"-117\"><mutation component_type=\"Button\" is_generic=\"false\" instance_name=\"按钮1\" event_name=\"Click\"></mutation><field name=\"COMPONENT_SELECTOR\">按钮1</field><statement name=\"DO\"><block type=\"component_set_get\" id=\"$nfd]!X9+C#;h~(kD~(3\"><mutation component_type=\"Label\" set_or_get=\"set\" property_name=\"Text\" is_generic=\"false\" instance_name=\"标签1\"></mutation><field name=\"COMPONENT_SELECTOR\">标签1</field><field name=\"PROP\">Text</field><value name=\"VALUE\"><block type=\"dictionaries_lookup\" id=\"b=,g9lLTKXK6hI}(`L1C\"><value name=\"KEY\"><block type=\"text\" id=\"6A9H:*a)yF0+ux9g0Gu0\"><field name=\"TEXT\">value</field></block></value><value name=\"DICT\"><block type=\"lists_select_item\" id=\"@.6~ZfJxEhU0}7@W=He;\"><value name=\"LIST\"><block type=\"dictionaries_lookup\" id=\"#dKIuZ0Gpc]f[ZeAGSh]\"><value name=\"KEY\"><block type=\"text\" id=\"r0IdGUhi!a)_tL#)4rB$\"><field name=\"TEXT\">RTValue</field></block></value><value name=\"DICT\"><block type=\"component_method\" id=\"A0Bq.1zjXx-Ar+r4Va5i\"><mutation component_type=\"Web\" method_name=\"JsonTextDecodeWithDictionaries\" is_generic=\"false\" instance_name=\"Web客户端1\"></mutation><field name=\"COMPONENT_SELECTOR\">Web客户端1</field><value name=\"ARG0\"><block type=\"text\" id=\"f:p9O}Wph,lTE%R+bk~I\"><field name=\"TEXT\">{   \"RTValue\": [     {       \"name\": \"GQ-YIWANG-CHU-WD\",       \"value\": 75.45,       \"type\": 16,       \"quality\": 1,       \"timestamp\": 1772424139     },     {       \"name\": \"GQ-YIWANG-HUI-WD\",       \"value\": 35.02,       \"type\": 16,       \"quality\": 1,       \"timestamp\": 1772423665     },     {       \"name\": \"GQ-ERWANG-CHU-WD\",       \"value\": 37,       \"type\": 16,       \"quality\": 1,       \"timestamp\": 1772424394     },     {       \"name\": \"GQ-ERWANG-HUI-WD\",       \"value\": 35.2,       \"type\": 16,       \"quality\": 1,       \"timestamp\": 1772424073     },     {       \"name\": \"GQ-YIWANG-CHU-YL\",       \"value\": 0.24,       \"type\": 16,       \"quality\": 1,       \"timestamp\": 1772424355     },     {       \"name\": \"GQ-YIWANG-HUI-YL\",       \"value\": 0.24,       \"type\": 16,       \"quality\": 1,       \"timestamp\": 1772424376     },     {       \"name\": \"GQ-ERWANG-CHU-YL\",       \"value\": 0.51,       \"type\": 16,       \"quality\": 1,       \"timestamp\": 1772424328     },     {       \"name\": \"GQ-ERWANG-HUI-YL\",       \"value\": 0.46,       \"type\": 16,       \"quality\": 1,       \"timestamp\": 1772424391     },     {       \"name\": \"GQ-XHB-PL-GD-DU\",       \"value\": 38,       \"type\": 16,       \"quality\": 1,       \"timestamp\": 1772424301     },     {       \"name\": \"YIWANG-CHU-WD\",       \"value\": 75.85,       \"type\": 16,       \"quality\": 1,       \"timestamp\": 1772424273     },     {       \"name\": \"YIWANG-HUI-WD\",       \"value\": 35.62,       \"type\": 16,       \"quality\": 1,       \"timestamp\": 1772424372     },     {       \"name\": \"ERWANG-CHU-WD\",       \"value\": 40.9,       \"type\": 16,       \"quality\": 1,       \"timestamp\": 1772424393     },     {       \"name\": \"ERWANG-HUI-WD\",       \"value\": 34.7,       \"type\": 16,       \"quality\": 1,       \"timestamp\": 1772424378     },     {       \"name\": \"YIWANG-CHU-YL\",       \"value\": 0.25,       \"type\": 16,       \"quality\": 1,       \"timestamp\": 1772424375     },     {       \"name\": \"YIWANG-HUI-YL\",       \"value\": 0.23,       \"type\": 16,       \"quality\": 1,       \"timestamp\": 1772424351     },     {       \"name\": \"ERWANG-CHU-YL\",       \"value\": 0.5,       \"type\": 16,       \"quality\": 1,       \"timestamp\": 1772424381     },     {       \"name\": \"ERWANG-HUI-YL\",       \"value\": 0.42,       \"type\": 16,       \"quality\": 1,       \"timestamp\": 1772424387     },     {       \"name\": \"XHB-PL-GD-DU\",       \"value\": 38,       \"type\": 16,       \"quality\": 1,       \"timestamp\": 1772351919     }   ] }</field></block></value></block></value><value name=\"NOTFOUND\"><block type=\"text\" id=\"/M{?:@@XDq{GYyytXnrr\"><field name=\"TEXT\">not found</field></block></value></block></value><value name=\"NUM\"><block type=\"math_number\" id=\"7Y$B20{RIbyEM^(G#OmG\"><field name=\"NUM\">1</field></block></value></block></value><value name=\"NOTFOUND\"><block type=\"text\" id=\"3Dr!c5%2^0)mxcFeSf`I\"><field name=\"TEXT\">not found</field></block></value></block></value></block></statement></block></xml>"]}
    App Inventor 2 中文网 - MIT同步更新的中文本土化平台!v2.76 支持Android 15 & iOS 更新日志
  • TA的每日心情
    开心
    昨天 06:46
  • 签到天数: 741 天

    [LV.9]以坛为家II

    1050

    主题

    1735

    帖子

    4万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    积分
    49802

    AI2中文网VIP弹球达人接水果达人撸猫达人

    14#
    发表于 4 天前 | 只看该作者
    ❌ 失败 2 项:
    • 代码块添加失败,工作区已恢复: 块 component_event 结构不完整 mutation=<mutation xmlns="http://www.w3.org/1999/xhtml" component_type="Screen" is_generic="false" instance_name="Screen2" event_
    • 代码块添加失败,工作区已恢复: 块 component_event: Attempt to connect incompatible types.

    [
      {
        "action": "ADD_BLOCK",
        "xml": "<block type=\"global_declaration\" x=\"20\" y=\"20\"><field name=\"NAME\">taskList</field><value name=\"VALUE\"><block type=\"lists_create_with\"><mutation items=\"0\"></mutation></block></value></block>"
      },
      {
        "action": "ADD_BLOCK",
        "xml": "<block type=\"component_event\" x=\"20\" y=\"100\"><mutation component_type=\"Screen\" is_generic=\"false\" instance_name=\"Screen2\" event_name=\"Initialize\"></mutation><field name=\"COMPONENT_SELECTOR\">Screen2</field><statement name=\"DO\"><block type=\"controls_if\"><value name=\"IF0\"><block type=\"logic_compare\"><field name=\"OP\">GT</field><value name=\"A\"><block type=\"lists_length\"><value name=\"LIST\"><block type=\"component_method\"><mutation component_type=\"TinyDB\" method_name=\"GetValue\" is_generic=\"false\" instance_name=\"LocalDB\"></mutation><field name=\"COMPONENT_SELECTOR\">LocalDB</field><value name=\"ARG0\"><block type=\"text\"><field name=\"TEXT\">tasks</field></block></value><value name=\"ARG1\"><block type=\"lists_create_with\"><mutation items=\"0\"></mutation></block></value></block></value></block></value><value name=\"B\"><block type=\"math_number\"><field name=\"NUM\">0</field></block></value></block></value><statement name=\"DO0\"><block type=\"lexical_variable_set\"><field name=\"VAR\">global taskList</field><value name=\"VALUE\"><block type=\"component_method\"><mutation component_type=\"TinyDB\" method_name=\"GetValue\" is_generic=\"false\" instance_name=\"LocalDB\"></mutation><field name=\"COMPONENT_SELECTOR\">LocalDB</field><value name=\"ARG0\"><block type=\"text\"><field name=\"TEXT\">tasks</field></block></value><value name=\"ARG1\"><block type=\"lists_create_with\"><mutation items=\"0\"></mutation></block></value></block></value></block><next><block type=\"component_set_get\"><mutation component_type=\"ListView\" set_or_get=\"set\" property_name=\"Elements\" is_generic=\"false\" instance_name=\"TaskList\"></mutation><field name=\"COMPONENT_SELECTOR\">TaskList</field><field name=\"PROP\">Elements</field><value name=\"VALUE\"><block type=\"lexical_variable_get\"><field name=\"VAR\">global taskList</field></block></value></block></next></block></statement></block></statement></block>"
      },
      {
        "action": "ADD_BLOCK",
        "xml": "<block type=\"component_event\" x=\"20\" y=\"300\"><mutation component_type=\"Button\" is_generic=\"false\" instance_name=\"AddButton\" event_name=\"Click\"></mutation><field name=\"COMPONENT_SELECTOR\">AddButton</field><statement name=\"DO\"><block type=\"controls_if\"><value name=\"IF0\"><block type=\"logic_negate\"><value name=\"BOOL\"><block type=\"text_isEmpty\"><value name=\"VALUE\"><block type=\"component_set_get\"><mutation component_type=\"TextBox\" set_or_get=\"get\" property_name=\"Text\" is_generic=\"false\" instance_name=\"TaskInput\"></mutation><field name=\"COMPONENT_SELECTOR\">TaskInput</field><field name=\"PROP\">Text</field></block></value></block></value></block></value><statement name=\"DO0\"><block type=\"lists_add_items\"><mutation items=\"1\"></mutation><value name=\"LIST\"><block type=\"lexical_variable_get\"><field name=\"VAR\">global taskList</field></block></value><value name=\"ITEM0\"><block type=\"component_set_get\"><mutation component_type=\"TextBox\" set_or_get=\"get\" property_name=\"Text\" is_generic=\"false\" instance_name=\"TaskInput\"></mutation><field name=\"COMPONENT_SELECTOR\">TaskInput</field><field name=\"PROP\">Text</field></block></value></block><next><block type=\"component_set_get\"><mutation component_type=\"ListView\" set_or_get=\"set\" property_name=\"Elements\" is_generic=\"false\" instance_name=\"TaskList\"></mutation><field name=\"COMPONENT_SELECTOR\">TaskList</field><field name=\"PROP\">Elements</field><value name=\"VALUE\"><block type=\"lexical_variable_get\"><field name=\"VAR\">global taskList</field></block></value></block><next><block type=\"component_method\"><mutation component_type=\"TinyDB\" method_name=\"StoreValue\" is_generic=\"false\" instance_name=\"LocalDB\"></mutation><field name=\"COMPONENT_SELECTOR\">LocalDB</field><value name=\"ARG0\"><block type=\"text\"><field name=\"TEXT\">tasks</field></block></value><value name=\"ARG1\"><block type=\"lexical_variable_get\"><field name=\"VAR\">global taskList</field></block></value></block><next><block type=\"component_set_get\"><mutation component_type=\"TextBox\" set_or_get=\"set\" property_name=\"Text\" is_generic=\"false\" instance_name=\"TaskInput\"></mutation><field name=\"COMPONENT_SELECTOR\">TaskInput</field><field name=\"PROP\">Text</field><value name=\"VALUE\"><block type=\"text\"><field name=\"TEXT\"></field></block></value></block></next></block></next></block></next></block></statement></block></statement></block>"
      },
      {
        "action": "ADD_BLOCK",
        "xml": "<block type=\"component_event\" x=\"20\" y=\"500\"><mutation component_type=\"Button\" is_generic=\"false\" instance_name=\"DeleteButton\" event_name=\"Click\"></mutation><field name=\"COMPONENT_SELECTOR\">DeleteButton</field><statement name=\"DO\"><block type=\"controls_if\"><value name=\"IF0\"><block type=\"logic_compare\"><field name=\"OP\">GT</field><value name=\"A\"><block type=\"component_set_get\"><mutation component_type=\"ListView\" set_or_get=\"get\" property_name=\"SelectionIndex\" is_generic=\"false\" instance_name=\"TaskList\"></mutation><field name=\"COMPONENT_SELECTOR\">TaskList</field><field name=\"PROP\">SelectionIndex</field></block></value><value name=\"B\"><block type=\"math_number\"><field name=\"NUM\">0</field></block></value></block></value><statement name=\"DO0\"><block type=\"lists_select_item\"><value name=\"LIST\"><block type=\"lexical_variable_get\"><field name=\"VAR\">global taskList</field></block></value><value name=\"NUM\"><block type=\"component_set_get\"><mutation component_type=\"ListView\" set_or_get=\"get\" property_name=\"SelectionIndex\" is_generic=\"false\" instance_name=\"TaskList\"></mutation><field name=\"COMPONENT_SELECTOR\">TaskList</field><field name=\"PROP\">SelectionIndex</field></block></value></block><next><block type=\"component_set_get\"><mutation component_type=\"ListView\" set_or_get=\"set\" property_name=\"Elements\" is_generic=\"false\" instance_name=\"TaskList\"></mutation><field name=\"COMPONENT_SELECTOR\">TaskList</field><field name=\"PROP\">Elements</field><value name=\"VALUE\"><block type=\"lexical_variable_get\"><field name=\"VAR\">global taskList</field></block></value></block><next><block type=\"component_method\"><mutation component_type=\"TinyDB\" method_name=\"StoreValue\" is_generic=\"false\" instance_name=\"LocalDB\"></mutation><field name=\"COMPONENT_SELECTOR\">LocalDB</field><value name=\"ARG0\"><block type=\"text\"><field name=\"TEXT\">tasks</field></block></value><value name=\"ARG1\"><block type=\"lexical_variable_get\"><field name=\"VAR\">global taskList</field></block></value></block></next></block></next></block></statement></block></statement></block>"
      },
      {
        "action": "CLEANUP_BLOCKS"
      }
    ]
    App Inventor 2 中文网 - MIT同步更新的中文本土化平台!v2.76 支持Android 15 & iOS 更新日志
  • TA的每日心情
    开心
    昨天 06:46
  • 签到天数: 741 天

    [LV.9]以坛为家II

    1050

    主题

    1735

    帖子

    4万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    积分
    49802

    AI2中文网VIP弹球达人接水果达人撸猫达人

    15#
    发表于 3 天前 | 只看该作者
    ode-0.js:100059 Failed to show flydown TypeError: element.getAttribute is not a function
        at Blockly.utils.getRelativeXY (ode-0.js:70433:25)
        at Blockly.WorkspaceSvg.getSvgXY (ode-0.js:71437:32)
        at Blockly.FieldFlydown.showFlydown_ (ode-0.js:100077:43)
        at ode-0.js:100056:19
    (anonymous) @ ode-0.js:100059
    setTimeout
    Blockly.FieldFlydown.onMouseOver_ @ ode-0.js:100042
    wrapFunc @ ode-0.js:85991
    touchWrapFunc @ ode-0.js:86003
    2:8088/#6346381115523072:1 Uncaught (in promise) Error: A listener indicated an asynchronous response by returning true, but the message channel closed before a response was received
    ode-3.js:12778 [AIController] 嵌套块验证失败: 组件 'Clock1' 不存在,请先在设计视图中添加该组件



    修复的必要性不大,中间那个是chrome的报错。其余ai改了,但是必要性不大,算了。
    App Inventor 2 中文网 - MIT同步更新的中文本土化平台!v2.76 支持Android 15 & iOS 更新日志
  • TA的每日心情
    开心
    昨天 06:46
  • 签到天数: 741 天

    [LV.9]以坛为家II

    1050

    主题

    1735

    帖子

    4万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    积分
    49802

    AI2中文网VIP弹球达人接水果达人撸猫达人

    16#
    发表于 3 天前 | 只看该作者
    代码块添加失败,工作区已恢复: 块 component_event: Assertion failed: Error: "component_get_get" is an unknown language block.


    [
      {
        "action": "ADD_BLOCK",
        "xml": "<block type=\"component_event\" x=\"20\" y=\"20\"><mutation component_type=\"Button\" is_generic=\"false\" instance_name=\"CalculateButton\" event_name=\"Click\"></mutation><field name=\"COMPONENT_SELECTOR\">CalculateButton</field><statement name=\"DO\"><block type=\"local_declaration_statement\"><field name=\"VAR\">height</field><value name=\"VALUE\"><block type=\"math_arithmetic\"><field name=\"OP\">DIVIDE</field><value name=\"A\"><block type=\"component_method\"><mutation component_type=\"TextBox\" method_name=\"TextToNumber\" is_generic=\"false\" instance_name=\"HeightTextBox\"></mutation><field name=\"COMPONENT_SELECTOR\">HeightTextBox</field></block></value><value name=\"B\"><block type=\"math_number\"><field name=\"NUM\">100</field></block></value></block></value><next><block type=\"local_declaration_statement\"><field name=\"VAR\">weight</field><value name=\"VALUE\"><block type=\"component_method\"><mutation component_type=\"TextBox\" method_name=\"TextToNumber\" is_generic=\"false\" instance_name=\"WeightTextBox\"></mutation><field name=\"COMPONENT_SELECTOR\">WeightTextBox</field></block></value><next><block type=\"local_declaration_statement\"><field name=\"VAR\">bmi</field><value name=\"VALUE\"><block type=\"math_arithmetic\"><field name=\"OP\">DIVIDE</field><value name=\"A\"><block type=\"lexical_variable_get\"><field name=\"VAR\">weight</field></block></value><value name=\"B\"><block type=\"math_arithmetic\"><field name=\"OP\">MULTIPLY</field><value name=\"A\"><block type=\"lexical_variable_get\"><field name=\"VAR\">height</field></block></value><value name=\"B\"><block type=\"lexical_variable_get\"><field name=\"VAR\">height</field></block></value></block></value></block></value><next><block type=\"component_set_get\"><mutation component_type=\"Label\" set_or_get=\"set\" property_name=\"Text\" is_generic=\"false\" instance_name=\"ResultLabel\"></mutation><field name=\"COMPONENT_SELECTOR\">ResultLabel</field><field name=\"PROP\">Text</field><value name=\"VALUE\"><block type=\"text_join\"><mutation items=\"2\"></mutation><value name=\"ADD0\"><block type=\"text\"><field name=\"TEXT\">BMI值:</field></block></value><value name=\"ADD1\"><block type=\"text\"><field name=\"TEXT\"> </field></block></value></block></value><next><block type=\"component_set_get\"><mutation component_type=\"Label\" set_or_get=\"set\" property_name=\"Text\" is_generic=\"false\" instance_name=\"ResultLabel\"></mutation><field name=\"COMPONENT_SELECTOR\">ResultLabel</field><field name=\"PROP\">Text</field><value name=\"VALUE\"><block type=\"text_join\"><mutation items=\"2\"></mutation><value name=\"ADD0\"><block type=\"component_get_get\"><mutation component_type=\"Label\" set_or_get=\"get\" property_name=\"Text\" is_generic=\"false\" instance_name=\"ResultLabel\"></mutation><field name=\"COMPONENT_SELECTOR\">ResultLabel</field><field name=\"PROP\">Text</field></block></value><value name=\"ADD1\"><block type=\"component_method\"><mutation component_type=\"Label\" method_name=\"FormatAsDecimal\" is_generic=\"false\" instance_name=\"ResultLabel\"></mutation><field name=\"COMPONENT_SELECTOR\">ResultLabel</field><value name=\"ARG0\"><block type=\"lexical_variable_get\"><field name=\"VAR\">bmi</field></block></value><value name=\"ARG1\"><block type=\"math_number\"><field name=\"NUM\">1</field></block></value></block></value></block></value><next><block type=\"controls_if\"><mutation elseif=\"3\" else=\"1\"></mutation><value name=\"IF0\"><block type=\"logic_compare\"><field name=\"OP\">LT</field><value name=\"A\"><block type=\"lexical_variable_get\"><field name=\"VAR\">bmi</field></block></value><value name=\"B\"><block type=\"math_number\"><field name=\"NUM\">18.5</field></block></value></block></value><statement name=\"DO0\"><block type=\"component_set_get\"><mutation component_type=\"Label\" set_or_get=\"set\" property_name=\"Text\" is_generic=\"false\" instance_name=\"AdviceLabel\"></mutation><field name=\"COMPONENT_SELECTOR\">AdviceLabel</field><field name=\"PROP\">Text</field><value name=\"VALUE\"><block type=\"text\"><field name=\"TEXT\">偏瘦,建议增加营养摄入</field></block></value></block></statement><value name=\"IF1\"><block type=\"logic_compare\"><field name=\"OP\">LT</field><value name=\"A\"><block type=\"lexical_variable_get\"><field name=\"VAR\">bmi</field></block></value><value name=\"B\"><block type=\"math_number\"><field name=\"NUM\">24</field></block></value></block></value><statement name=\"DO1\"><block type=\"component_set_get\"><mutation component_type=\"Label\" set_or_get=\"set\" property_name=\"Text\" is_generic=\"false\" instance_name=\"AdviceLabel\"></mutation><field name=\"COMPONENT_SELECTOR\">AdviceLabel</field><field name=\"PROP\">Text</field><value name=\"VALUE\"><block type=\"text\"><field name=\"TEXT\">正常,继续保持健康生活方式</field></block></value></block></statement><value name=\"IF2\"><block type=\"logic_compare\"><field name=\"OP\">LT</field><value name=\"A\"><block type=\"lexical_variable_get\"><field name=\"VAR\">bmi</field></block></value><value name=\"B\"><block type=\"math_number\"><field name=\"NUM\">28</field></block></value></block></value><statement name=\"DO2\"><block type=\"component_set_get\"><mutation component_type=\"Label\" set_or_get=\"set\" property_name=\"Text\" is_generic=\"false\" instance_name=\"AdviceLabel\"></mutation><field name=\"COMPONENT_SELECTOR\">AdviceLabel</field><field name=\"PROP\">Text</field><value name=\"VALUE\"><block type=\"text\"><field name=\"TEXT\">超重,建议适当控制饮食和增加运动</field></block></value></block></statement><value name=\"IF3\"><block type=\"logic_compare\"><field name=\"OP\">LT</field><value name=\"A\"><block type=\"lexical_variable_get\"><field name=\"VAR\">bmi</field></block></value><value name=\"B\"><block type=\"math_number\"><field name=\"NUM\">32</field></block></value></block></value><statement name=\"DO3\"><block type=\"component_set_get\"><mutation component_type=\"Label\" set_or_get=\"set\" property_name=\"Text\" is_generic=\"false\" instance_name=\"AdviceLabel\"></mutation><field name=\"COMPONENT_SELECTOR\">AdviceLabel</field><field name=\"PROP\">Text</field><value name=\"VALUE\"><block type=\"text\"><field name=\"TEXT\">肥胖,建议咨询医生制定减重计划</field></block></value></block></statement><statement name=\"ELSE\"><block type=\"component_set_get\"><mutation component_type=\"Label\" set_or_get=\"set\" property_name=\"Text\" is_generic=\"false\" instance_name=\"AdviceLabel\"></mutation><field name=\"COMPONENT_SELECTOR\">AdviceLabel</field><field name=\"PROP\">Text</field><value name=\"VALUE\"><block type=\"text\"><field name=\"TEXT\">重度肥胖,请立即就医</field></block></value></block></statement></block></next></block></next></block></next></block></next></block></statement></block>"
      },
      {
        "action": "CLEANUP_BLOCKS"
      }



    App Inventor 2 中文网 - MIT同步更新的中文本土化平台!v2.76 支持Android 15 & iOS 更新日志
  • TA的每日心情
    开心
    昨天 06:46
  • 签到天数: 741 天

    [LV.9]以坛为家II

    1050

    主题

    1735

    帖子

    4万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    积分
    49802

    AI2中文网VIP弹球达人接水果达人撸猫达人

    17#
    发表于 昨天 22:55 | 只看该作者
    ✅ 执行完成:添加了 7 个代码块,1 项失败
    代码块:全局变量 ×3、事件处理 ×4
    ❌ 失败 1 项:
    • 代码块添加失败,工作区已恢复: 块 component_event: Assertion failed: Error: "math_arithmetic" is an unknown language block.

    [
      {
        "action": "ADD_BLOCK",
        "xml": "<block type=\"global_declaration\" x=\"20\" y=\"20\"><field name=\"NAME\">isPlaying</field><value name=\"VALUE\"><block type=\"logic_boolean\"><field name=\"BOOL\">FALSE</field></block></value></block>"
      },
      {
        "action": "ADD_BLOCK",
        "xml": "<block type=\"global_declaration\" x=\"20\" y=\"100\"><field name=\"NAME\">currentSongIndex</field><value name=\"VALUE\"><block type=\"math_number\"><field name=\"NUM\">0</field></block></value></block>"
      },
      {
        "action": "ADD_BLOCK",
        "xml": "<block type=\"global_declaration\" x=\"20\" y=\"180\"><field name=\"NAME\">songList</field><value name=\"VALUE\"><block type=\"lists_create_with\"><mutation items=\"3\"></mutation><value name=\"ADD0\"><block type=\"text\"><field name=\"TEXT\">song1.mp3</field></block></value><value name=\"ADD1\"><block type=\"text\"><field name=\"TEXT\">song2.mp3</field></block></value><value name=\"ADD2\"><block type=\"text\"><field name=\"TEXT\">song3.mp3</field></block></value></block></value></block>"
      },
      {
        "action": "ADD_BLOCK",
        "xml": "<block type=\"component_event\" x=\"20\" y=\"260\"><mutation component_type=\"Form\" is_generic=\"false\" instance_name=\"Screen3\" event_name=\"Initialize\"></mutation><field name=\"COMPONENT_SELECTOR\">Screen3</field><statement name=\"DO\"><block type=\"component_set_get\"><mutation component_type=\"Player\" set_or_get=\"set\" property_name=\"Source\" is_generic=\"false\" instance_name=\"Player1\"></mutation><field name=\"COMPONENT_SELECTOR\">Player1</field><field name=\"PROP\">Source</field><value name=\"VALUE\"><block type=\"lists_select_item\"><value name=\"LIST\"><block type=\"lexical_variable_get\"><field name=\"VAR\">global songList</field></block></value><value name=\"NUM\"><block type=\"lexical_variable_get\"><field name=\"VAR\">global currentSongIndex</field></block></value></block></value></block></statement></block>"
      },
      {
        "action": "ADD_BLOCK",
        "xml": "<block type=\"component_event\" x=\"20\" y=\"340\"><mutation component_type=\"Button\" is_generic=\"false\" instance_name=\"PlayPauseButton\" event_name=\"Click\"></mutation><field name=\"COMPONENT_SELECTOR\">PlayPauseButton</field><statement name=\"DO\"><block type=\"controls_if\"><mutation else=\"1\"></mutation><value name=\"IF0\"><block type=\"lexical_variable_get\"><field name=\"VAR\">global isPlaying</field></block></value><statement name=\"DO0\"><block type=\"component_method\"><mutation component_type=\"Player\" method_name=\"Pause\" is_generic=\"false\" instance_name=\"Player1\"></mutation><field name=\"COMPONENT_SELECTOR\">Player1</field></block><block type=\"component_set_get\"><mutation component_type=\"Button\" set_or_get=\"set\" property_name=\"Text\" is_generic=\"false\" instance_name=\"PlayPauseButton\"></mutation><field name=\"COMPONENT_SELECTOR\">PlayPauseButton</field><field name=\"PROP\">Text</field><value name=\"VALUE\"><block type=\"text\"><field name=\"TEXT\">▶</field></block></value></block><block type=\"lexical_variable_set\"><field name=\"VAR\">global isPlaying</field><value name=\"VALUE\"><block type=\"logic_boolean\"><field name=\"BOOL\">FALSE</field></block></value></block></statement><statement name=\"ELSE\"><block type=\"component_method\"><mutation component_type=\"Player\" method_name=\"Start\" is_generic=\"false\" instance_name=\"Player1\"></mutation><field name=\"COMPONENT_SELECTOR\">Player1</field></block><block type=\"component_set_get\"><mutation component_type=\"Button\" set_or_get=\"set\" property_name=\"Text\" is_generic=\"false\" instance_name=\"PlayPauseButton\"></mutation><field name=\"COMPONENT_SELECTOR\">PlayPauseButton</field><field name=\"PROP\">Text</field><value name=\"VALUE\"><block type=\"text\"><field name=\"TEXT\">⏸</field></block></value></block><block type=\"lexical_variable_set\"><field name=\"VAR\">global isPlaying</field><value name=\"VALUE\"><block type=\"logic_boolean\"><field name=\"BOOL\">TRUE</field></block></value></block></statement></block></statement></block>"
      },
      {
        "action": "ADD_BLOCK",
        "xml": "<block type=\"component_event\" x=\"20\" y=\"420\"><mutation component_type=\"Button\" is_generic=\"false\" instance_name=\"PrevButton\" event_name=\"Click\"></mutation><field name=\"COMPONENT_SELECTOR\">PrevButton</field><statement name=\"DO\"><block type=\"controls_if\"><value name=\"IF0\"><block type=\"logic_compare\"><field name=\"OP\">GT</field><value name=\"A\"><block type=\"lexical_variable_get\"><field name=\"VAR\">global currentSongIndex</field></block></value><value name=\"B\"><block type=\"math_number\"><field name=\"NUM\">0</field></block></value></block></value><statement name=\"DO0\"><block type=\"lexical_variable_set\"><field name=\"VAR\">global currentSongIndex</field><value name=\"VALUE\"><block type=\"math_arithmetic\"><field name=\"OP\">MINUS</field><value name=\"A\"><block type=\"lexical_variable_get\"><field name=\"VAR\">global currentSongIndex</field></block></value><value name=\"B\"><block type=\"math_number\"><field name=\"NUM\">1</field></block></value></block></value></block><block type=\"component_set_get\"><mutation component_type=\"Player\" set_or_get=\"set\" property_name=\"Source\" is_generic=\"false\" instance_name=\"Player1\"></mutation><field name=\"COMPONENT_SELECTOR\">Player1</field><field name=\"PROP\">Source</field><value name=\"VALUE\"><block type=\"lists_select_item\"><value name=\"LIST\"><block type=\"lexical_variable_get\"><field name=\"VAR\">global songList</field></block></value><value name=\"NUM\"><block type=\"lexical_variable_get\"><field name=\"VAR\">global currentSongIndex</field></block></value></block></value></block><block type=\"component_method\"><mutation component_type=\"Player\" method_name=\"Start\" is_generic=\"false\" instance_name=\"Player1\"></mutation><field name=\"COMPONENT_SELECTOR\">Player1</field></block><block type=\"component_set_get\"><mutation component_type=\"Button\" set_or_get=\"set\" property_name=\"Text\" is_generic=\"false\" instance_name=\"PlayPauseButton\"></mutation><field name=\"COMPONENT_SELECTOR\">PlayPauseButton</field><field name=\"PROP\">Text</field><value name=\"VALUE\"><block type=\"text\"><field name=\"TEXT\">⏸</field></block></value></block><block type=\"lexical_variable_set\"><field name=\"VAR\">global isPlaying</field><value name=\"VALUE\"><block type=\"logic_boolean\"><field name=\"BOOL\">TRUE</field></block></value></block></statement></block></statement></block>"
      },
      {
        "action": "ADD_BLOCK",
        "xml": "<block type=\"component_event\" x=\"20\" y=\"500\"><mutation component_type=\"Button\" is_generic=\"false\" instance_name=\"NextButton\" event_name=\"Click\"></mutation><field name=\"COMPONENT_SELECTOR\">NextButton</field><statement name=\"DO\"><block type=\"controls_if\"><value name=\"IF0\"><block type=\"logic_compare\"><field name=\"OP\">LT</field><value name=\"A\"><block type=\"lexical_variable_get\"><field name=\"VAR\">global currentSongIndex</field></block></value><value name=\"B\"><block type=\"math_arithmetic\"><field name=\"OP\">MINUS</field><value name=\"A\"><block type=\"lists_length\"><value name=\"LIST\"><block type=\"lexical_variable_get\"><field name=\"VAR\">global songList</field></block></value></block></value><value name=\"B\"><block type=\"math_number\"><field name=\"NUM\">1</field></block></value></block></value></block></value><statement name=\"DO0\"><block type=\"lexical_variable_set\"><field name=\"VAR\">global currentSongIndex</field><value name=\"VALUE\"><block type=\"math_arithmetic\"><field name=\"OP\">ADD</field><value name=\"A\"><block type=\"lexical_variable_get\"><field name=\"VAR\">global currentSongIndex</field></block></value><value name=\"B\"><block type=\"math_number\"><field name=\"NUM\">1</field></block></value></block></value></block><block type=\"component_set_get\"><mutation component_type=\"Player\" set_or_get=\"set\" property_name=\"Source\" is_generic=\"false\" instance_name=\"Player1\"></mutation><field name=\"COMPONENT_SELECTOR\">Player1</field><field name=\"PROP\">Source</field><value name=\"VALUE\"><block type=\"lists_select_item\"><value name=\"LIST\"><block type=\"lexical_variable_get\"><field name=\"VAR\">global songList</field></block></value><value name=\"NUM\"><block type=\"lexical_variable_get\"><field name=\"VAR\">global currentSongIndex</field></block></value></block></value></block><block type=\"component_method\"><mutation component_type=\"Player\" method_name=\"Start\" is_generic=\"false\" instance_name=\"Player1\"></mutation><field name=\"COMPONENT_SELECTOR\">Player1</field></block><block type=\"component_set_get\"><mutation component_type=\"Button\" set_or_get=\"set\" property_name=\"Text\" is_generic=\"false\" instance_name=\"PlayPauseButton\"></mutation><field name=\"COMPONENT_SELECTOR\">PlayPauseButton</field><field name=\"PROP\">Text</field><value name=\"VALUE\"><block type=\"text\"><field name=\"TEXT\">⏸</field></block></value></block><block type=\"lexical_variable_set\"><field name=\"VAR\">global isPlaying</field><value name=\"VALUE\"><block type=\"logic_boolean\"><field name=\"BOOL\">TRUE</field></block></value></block></statement></block></statement></block>"
      },
      {
        "action": "ADD_BLOCK",
        "xml": "<block type=\"component_event\" x=\"20\" y=\"580\"><mutation component_type=\"Player\" is_generic=\"false\" instance_name=\"Player1\" event_name=\"Completed\"></mutation><field name=\"COMPONENT_SELECTOR\">Player1</field><statement name=\"DO\"><block type=\"component_set_get\"><mutation component_type=\"Button\" set_or_get=\"set\" property_name=\"Text\" is_generic=\"false\" instance_name=\"PlayPauseButton\"></mutation><field name=\"COMPONENT_SELECTOR\">PlayPauseButton</field><field name=\"PROP\">Text</field><value name=\"VALUE\"><block type=\"text\"><field name=\"TEXT\">▶</field></block></value></block><block type=\"lexical_variable_set\"><field name=\"VAR\">global isPlaying</field><value name=\"VALUE\"><block type=\"logic_boolean\"><field name=\"BOOL\">FALSE</field></block></value></block></statement></block>"
      },
      {
        "action": "CLEANUP_BLOCKS"
      }
    ]
    App Inventor 2 中文网 - MIT同步更新的中文本土化平台!v2.76 支持Android 15 & iOS 更新日志
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    © 2026 tsingfun.com, Inc.  沪ICP备2020034476号-1  沪公网安备31011702000040号

    GMT+8, 2026-03-06 04:01 , Processed in 0.026679 second(s), 34 queries .