Solve Error: "errcode": 40016, "errmsg": "invalid button size hint"(示例

Posted grandyang

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Solve Error: "errcode": 40016, "errmsg": "invalid button size hint"(示例相关的知识,希望对你有一定的参考价值。

 

在使用微信官方给的添加自定义菜单的示例代码:

 

{
    "button": [
        {
            "name": "扫码", 
            "sub_button": [
                {
                    "type": "scancode_waitmsg", 
                    "name": "扫码带提示", 
                    "key": "rselfmenu_0_0", 
                    "sub_button": [ ]
                }, 
                {
                    "type": "scancode_push", 
                    "name": "扫码推事件", 
                    "key": "rselfmenu_0_1", 
                    "sub_button": [ ]
                }
            ]
        }, 
        {
            "name": "发图", 
            "sub_button": [
                {
                    "type": "pic_sysphoto", 
                    "name": "系统拍照发图", 
                    "key": "rselfmenu_1_0", 
                   "sub_button": [ ]
                 }, 
                {
                    "type": "pic_photo_or_album", 
                    "name": "拍照或者相册发图", 
                    "key": "rselfmenu_1_1", 
                    "sub_button": [ ]
                }, 
                {
                    "type": "pic_weixin", 
                    "name": "微信相册发图", 
                    "key": "rselfmenu_1_2", 
                    "sub_button": [ ]
                }
            ]
        }, 
        {
            "name": "发送位置", 
            "type": "location_select", 
            "key": "rselfmenu_2_0"
        },
        {
           "type": "media_id", 
           "name": "图片", 
           "media_id": "MEDIA_ID1"
        }, 
        {
           "type": "view_limited", 
           "name": "图文消息", 
           "media_id": "MEDIA_ID2"
        }
    ]
}

 

可能会遇到如下的错误:

Connection: keep-alive
Date: Sat, 24 Nov 2018 00:58:30 GMT
Content-Type: application/json; encoding=utf-8
Content-Length: 71
{
    "errcode": 40016, 
    "errmsg": "invalid button size hint: [dNjLEa01101961]"
}

 

原因可能是因为想展示的按钮太多了,装不下了,去掉最后两个就好了:

 

{
    "button": [
        {
            "name": "扫码", 
            "sub_button": [
                {
                    "type": "scancode_waitmsg", 
                    "name": "扫码带提示", 
                    "key": "rselfmenu_0_0", 
                    "sub_button": [ ]
                }, 
                {
                    "type": "scancode_push", 
                    "name": "扫码推事件", 
                    "key": "rselfmenu_0_1", 
                    "sub_button": [ ]
                }
            ]
        }, 
        {
            "name": "发图", 
            "sub_button": [
                {
                    "type": "pic_sysphoto", 
                    "name": "系统拍照发图", 
                    "key": "rselfmenu_1_0", 
                    "sub_button": [ ]
                }, 
                {
                    "type": "pic_photo_or_album", 
                    "name": "拍照或者相册发图", 
                    "key": "rselfmenu_1_1", 
                    "sub_button": [ ]
                }, 
                {
                    "type": "pic_weixin", 
                    "name": "微信相册发图", 
                    "key": "rselfmenu_1_2", 
                    "sub_button": [ ]
                }
            ]
        }, 
        {
            "name": "发送位置", 
            "type": "location_select", 
            "key": "rselfmenu_2_0"
        }
    ]
}

 

以上是关于Solve Error: "errcode": 40016, "errmsg": "invalid button size hint"(示例的主要内容,如果未能解决你的问题,请参考以下文章

Solve VS2010 Error "Exceptions has been thrown by the target of an invocation"

Solve Error: nafxcw.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new[](unsigned in

小程序云函数 Error: errCode: -404011 cloud function execution error

报错集:ERROR 3 (HY000): Error writing file ‘/tmp/psyZMRtme‘ (Errcode: 28 - No space left on device)

报错集:ERROR 3 (HY000): Error writing file ‘/tmp/psyZMRtme‘ (Errcode: 28 - No space left on device)

报错集:ERROR 3 (HY000): Error writing file ‘/tmp/psyZMRtme‘ (Errcode: 28 - No space left on device)