清泛IT社区
标题:
嵌套块验证失败:未知的代码块类型: procedures_ifreturn,已拒绝添加
[打印本页]
作者:
App Inventor 2
时间:
2026-02-26 21:44
标题:
嵌套块验证失败:未知的代码块类型: procedures_ifreturn,已拒绝添加
✓ 已切换到代码块视图
✗ 嵌套块验证失败:未知的代码块类型: procedures_ifreturn,已拒绝添加
✓ 代码块已整理
[
{
"action": "SWITCH_TO_BLOCKS"
},
{
"action": "ADD_BLOCK",
"xml": "<block type=\"procedures_defreturn\" x=\"20\" y=\"20\">\n <field name=\"NAME\">计算阶乘</field>\n <comment pinned=\"false\" h=\"80\" w=\"160\">计算一个非负整数的阶乘。\n输入:n (数字)\n返回:n! (数字)</comment>\n <statement name=\"STACK\">\n <block type=\"controls_if\">\n <mutation else=\"1\"></mutation>\n <value name=\"IF0\">\n <block type=\"logic_compare\">\n <field name=\"OP\">EQ</field>\n <value name=\"A\">\n <block type=\"procedures_callreturn\">\n <mutation name=\"计算阶乘\">\n <arg name=\"n\"></arg>\n </mutation>\n <field name=\"PROCNAME\">计算阶乘</field>\n </block>\n </value>\n <value name=\"B\">\n <block type=\"math_number\">\n <field name=\"NUM\">0</field>\n </block>\n </value>\n </block>\n </value>\n <statement name=\"DO0\">\n <block type=\"procedures_ifreturn\">\n <value name=\"VALUE\">\n <block type=\"math_number\">\n <field name=\"NUM\">1</field>\n </block>\n </value>\n </block>\n </statement>\n <statement name=\"ELSE\">\n <block type=\"procedures_ifreturn\">\n <value name=\"VALUE\">\n <block type=\"math_arithmetic\">\n <field name=\"OP\">MULTIPLY</field>\n <value name=\"A\">\n <block type=\"procedures_callreturn\">\n <mutation name=\"计算阶乘\">\n <arg name=\"n\"></arg>\n </mutation>\n <field name=\"PROCNAME\">计算阶乘</field>\n </block>\n </value>\n <value name=\"B\">\n <block type=\"math_arithmetic\">\n <field name=\"OP\">MINUS</field>\n <value name=\"A\">\n <block type=\"procedures_callreturn\">\n <mutation name=\"计算阶乘\">\n <arg name=\"n\"></arg>\n </mutation>\n <field name=\"PROCNAME\">计算阶乘</field>\n </block>\n </value>\n <value name=\"B\">\n <block type=\"math_number\">\n <field name=\"NUM\">1</field>\n </block>\n </value>\n </block>\n </value>\n </block>\n </value>\n </block>\n </statement>\n </block>\n </statement>\n <value name=\"RETURN\">\n <block type=\"math_number\">\n <field name=\"NUM\">0</field>\n </block>\n </value>\n</block>"
},
{
"action": "CLEANUP_BLOCKS"
}
作者:
App Inventor 2
时间:
2026-02-26 22:13
✓ 组件 Notifier1 添加成功
✓ 代码块已清空
✓ 成功添加了 1 个代码块
✓ 成功添加了 1 个代码块
✓ 成功添加了 1 个代码块
✓ 成功添加了 1 个代码块
✓ 成功添加了 1 个代码块
✗ 代码块添加失败,工作区已恢复: Assertion failed: Next statement does not exist.
✓ 成功添加了 1 个代码块
✗ 嵌套块验证失败:未知的代码块类型: math_arithmetic,已拒绝添加
作者:
App Inventor 2
时间:
2026-02-26 22:14
✓ 成功添加了 1 个代码块
✗ 嵌套块验证失败:未知的代码块类型: text_substring,已拒绝添加
✓ 成功添加了 1 个代码块
✓ 成功添加了 1 个代码块
✓ 成功添加了 1 个代码块
✓ 成功添加了 1 个代码块
✓ 成功添加了 1 个代码块
✓ 成功添加了 1 个代码块
✓ 成功添加了 1 个代码块
✓ 成功添加了 1 个代码块
✓ 成功添加了 1 个代码块
✓ 成功添加了 1 个代码块
✓ 成功添加了 1 个代码块
✓ 成功添加了 1 个代码块
✓ 成功添加了 1 个代码块
✓ 成功添加了 1 个代码块
✓ 成功添加了 1 个代码块
✓ 成功添加了 1 个代码块
✓ 代码块已整理
作者:
App Inventor 2
时间:
2026-03-01 18:30
嵌套块验证失败:组件 'Notifier1' 不存在,请先在设计视图中添加该组件,已拒绝添加
嵌套块验证失败:未知的代码块类型: math_arithmetic,已拒绝添加
作者:
App Inventor 2
时间:
2026-03-01 18:37
[
{
"action": "ADD_COMPONENT",
"type": "Button",
"name": "Button1",
"parent": "MainLayout",
"properties": {
"Width": -2,
"Height": -2,
"Text": "新按钮",
"TextColor": "&HFF000000",
"BackgroundColor": "&HFF4CAF50"
}
}
]
作者:
App Inventor 2
时间:
2026-03-01 19:16
局部变量 全局变量 很容易搞混
作者:
App Inventor 2
时间:
2026-03-01 19:19
AI伴侣出现错误: The operation FontSize cannot accept the arguments: , [""]
作者:
App Inventor 2
时间:
2026-03-01 19:27
ios隐私属性 设置失败
作者:
App Inventor 2
时间:
2026-03-01 21:15
大部分已修复
作者:
App Inventor 2
时间:
2026-03-01 22:10
导入ble:Cannot read properties of undefined (reading 'selectedComponents')
作者:
App Inventor 2
时间:
2026-03-01 22:10
✓ 代码块已整理 但是没有效果
作者:
App Inventor 2
时间:
2026-03-02 22:12
❌ 失败 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
时间:
2026-03-02 22:26
{"$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
时间:
2026-03-02 23:04
❌ 失败 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
时间:
2026-03-03 10:18
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
时间:
2026-03-03 21:56
代码块添加失败,工作区已恢复: 块 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
时间:
2026-03-05 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"
}
]
欢迎光临 清泛IT社区 (https://bbs.tsingfun.com/)
Powered by Discuz! X3.3