Cocos Creator v1.6.1 内测版发布帖

请大家使用测试版时一定要注意备份好自己的项目!

Cocos Creator v1.6.1-beta.2 内测版发布:

windows 版改用 7z 压缩,请大家下载免费解压程序 http://www.7-zip.org/

改动列表

v1.6.1-beta.2

  • [Prefab] 修复自动同步预制的坐标未能正确保存到场景中的问题
  • [JSB] 修复 EditBox 析构时由于 JS 委托对象被回收导致的偶现崩溃现象
  • [Engine] 修复WebGL模式下cc.Graphics填充过多个形状时,之前填充的颜色会产生变化。
  • [Spine] 修复 Spine 事件回调可能会出现转换 event data 失败的问题
  • [Engine] 修复 iOS 双击 home 上划关闭应用崩溃问题

v1.6.1-beta.1

  • [Editor] 修复被依赖的模块出现脚本错误时编辑器不能正常打开的问题
  • [Tiledmap] 单独为 CCSGTMXLayer 开启 DepthTest,解决遮挡错误的问题
  • [Label] 修复当 Label 创建时机过早时,赋值以后节点 size 未发生变化的问题
  • [RichText] 使 标签支持设定height及width,但维持基础原则"图像高不超过设定高行"
  • [WebView] 支持 setJavascriptInterfaceSchemesetOnJSCallback (仅在 Android 跟 iOS 中使用)
  • [Label] 修复动态设置 TTF 类型的 font 会导致 outline 丢失的问题
  • [Layout] 修复 Layout节点隐藏后再显示,不会刷新子节点位置的问题
  • [TypeScript] 修复某些 TypeScript 类相互继承后无法反序列化属性的 bug
  • [Camera] 修复部分摄像机 target 会导致 undefined reference 报错的问题
  • [Editor] 修复从 asset IPC 消息获取 script 信息时报错的问题。
  • [Properties] 修复在切换节点 active 属性的时候,会有一段时间 active 的 values 无法显示的问题
  • [Animation] 修复重复添加 AnimationClip 的时候报错的问题
  • [Properties] 修复批量复制时部分属性值丢失的问题
  • [Label] 修复重复创建 Label 会导致字体显示错误的问题
  • [Editor] 修复免编译预览的脚本可能会和 npm 第三方库脚本名冲突导致错误的问题

相关讨论请回复到本帖下,谢谢大家!

3赞

退出时崩溃的BUG修复没有合进这个版本?

感谢这个功能的合并,抓紧试试看:)

http://forum.cocos.com/t/js-seterrorreporter-1-6/49894/6

1.6.0引擎的js错误无法回调到js层,建议 ScriptingCore.cpp修改
跟@panda反馈过一次,希望1.6.1正式版本加上 :slight_smile:

void handlePendingException(JSContext *cx)
{
    JS::RootedValue err(cx);
    if (JS_GetPendingException(cx, &err) && err.isObject())
    {
        JS_ClearPendingException(cx);
        
        JS::RootedObject errObj(cx, err.toObjectOrNull());
        JSErrorReport *report = JS_ErrorFromException(cx, errObj);
        CCLOGERROR("JS Exception: %s, file: %s, lineno: %u\n", report->message().c_str(), report->filename, report->lineno);
        
        JS::RootedValue stack(cx);
        if (JS_GetProperty(cx, errObj, "stack", &stack) && stack.isString())
        {
            JS::RootedString jsstackStr(cx, stack.toString());
            char *stackStr = JS_EncodeStringToUTF8(cx, jsstackStr);
            CCLOGERROR("Stack: %s\n", stackStr);
        }
        
        // 错误回调给js    __errorHandler
        ScriptingCore::getInstance()->reportError(cx, report);

    }
}

1赞

模拟器dll加进去了么?

模拟器dll加进去了么?

测试了下,依然没有

[Layout] 修复 Layout节点隐藏后再显示,不会刷新子节点位置的问题

测试了下,没问题了。

1.6常驻节点还是有点问题(场景勾选自动释放资源),场景a(常驻节点)切换场景b场景,场景b中常驻节点显示实测:模拟器ok;web canvas ok;web webgl,节点纹理还是delete了,补充下web打包也是正常的,native没试过

cc.game.addPersistRootNode(this.test);
cc.loader.setAutoReleaseRecursively(this.test, false);

更新的好快,感谢~

出现一个很难复现的错误,但概率较高, 1.5.1 没出现过, 1.6.0 之后都有。 底层打出错误日志:
Response failed, error buffer: The network connection was lost.

之后 HttpRequest 就发不出 http 请求了, 总是报 timeout.

代码如下:

var xhr = cc.loader.getXMLHttpRequest();
xhr.cb = cb;
xhr.ontimeout = function(){
    xhr.isAborted = true;
    xhr.abort();
    if (xhr.cb){
        console.log("ontimeout");
        xhr.cb(-1, "ontimeout;" + url);
        xhr.cb = null;
    }
};
xhr.timeout = 15000;

xhr.onreadystatechange = function () {
    if (!xhr || xhr.isAborted){
        console.log("abourted");
        return;
    }
    if (xhr.readyState == 4) { 
        var response = xhr.responseText;
        if (xhr.cb){
            var resp = {};
            if(xhr.status == 200){
                resp = JSON.parse(response);
                if (resp.errorCode == ERROR_TOKEN_EXPIRED){
                    // 这里是我们的特殊退出处理, 防止多端登录。
                    tryQuit(true);
                }
                else{
                    xhr.cb(null, resp);    
                }
            }
            else{
                // 
                xhr.cb(xhr.status || -1, "on_" + xhr.status + ";" + url);
            }

            xhr.cb = null;
        }
    }
};

xhr.onerror = function(){
    if (xhr.cb){
        console.log("onerror");
        xhr.cb(-2, "onerror;" + url);
        xhr.cb = null;
    }
};

params = params || {};
var strParam = "";
for(var key in params) {
    if (strParam.length > 0){
       strParam = strParam + "&";
    }
    strParam = strParam + String.format("{0}={1}", key, params[key]);
}

if (cc.sys.isNative) {
    if("win32" != dy.utils.platform()){
        xhr.setRequestHeader("Accept-Encoding","gzip,deflate");    
    }     
}

method = method || "GET";
if(method == "GET"){
    if (strParam.length > 0){
        url = encodeURI(String.format("{0}?{1}&{2}={3}", url, strParam, "ts"+dy.utils.currentTick(), dy.utils.currentTick()));
    }
    xhr.open('GET', url, true);
    xhr.send();
}
else{
    xhr.open('POST', url, true);
    strParam = encodeURI(strParam);
    xhr.send(strParam);
}

看我之前 的帖子 是有问题

男神麻烦修复一下这个问题

http://forum.cocos.com/t/1-6-0-ccaudioengine/50104?u=wangfuguii

2017-08-22T04:39:32.588Z - normal: Simulator: JS Exception: _currentHovered._mouseListener is null, file: C:/CocosCreator/resources/cocos2d-x/simulator/win32//src/jsb_polyfill.js, lineno: 5957

2017-08-22T04:39:32.588Z - normal: Simulator:

2017-08-22T04:39:32.589Z - normal: Simulator: Stack: [23]</_mouseMoveHandler@C:/CocosCreator/resources/cocos2d-x/simulator/win32//src/jsb_polyfill.js:5957:25

2017-08-22T04:39:32.589Z - normal: Simulator: cc.EventListenerMouse.prototype.onMouseMove@C:/CocosCreator/resources/cocos2d-x/simulator/win32//script/jsb_cocos2d.js:315:5

2017-08-22T04:39:32.589Z - normal: Simulator:

2017-08-22T04:39:32.589Z - normal: Simulator:

2017-08-22T04:39:32.620Z - normal: Simulator: JS Exception: _currentHovered._mouseListener is null, file: C:/CocosCreator/resources/cocos2d-x/simulator/win32//src/jsb_polyfill.js, lineno: 5957

2017-08-22T04:39:32.621Z - normal: Simulator:

2017-08-22T04:39:32.621Z - normal: Simulator: Stack: [23]</_mouseMoveHandler@C:/CocosCreator/resources/cocos2d-x/simulator/win32//src/jsb_polyfill.js:5957:25

2017-08-22T04:39:32.621Z - normal: Simulator: cc.EventListenerMouse.prototype.onMouseMove@C:/CocosCreator/resources/cocos2d-x/simulator/win32//script/jsb_cocos2d.js:315:5

2017-08-22T04:39:32.621Z - normal: Simulator:

2017-08-22T04:39:32.621Z - normal: Simulator:

2017-08-22T04:39:32.622Z - normal: Simulator: JS Exception: _currentHovered._mouseListener is null, file: C:/CocosCreator/resources/cocos2d-x/simulator/win32//src/jsb_polyfill.js, lineno: 5957

2017-08-22T04:39:32.622Z - normal: Simulator:

2017-08-22T04:39:32.622Z - normal: Simulator: Stack: [23]</_mouseMoveHandler@C:/CocosCreator/resources/cocos2d-x/simulator/win32//src/jsb_polyfill.js:5957:25

2017-08-22T04:39:32.622Z - normal: Simulator: cc.EventListenerMouse.prototype.onMouseMove@C:/CocosCreator/resources/cocos2d-x/simulator/win32//script/jsb_cocos2d.js:315:5

2017-08-22T04:39:32.622Z - normal: Simulator:

2017-08-22T04:39:32.622Z - normal: Simulator:

2017-08-22T04:39:32.623Z - normal: Simulator: JS Exception: _currentHovered._mouseListener is null, file: C:/CocosCreator/resources/cocos2d-x/simulator/win32//src/jsb_polyfill.js, lineno: 5957

2017-08-22T04:39:32.623Z - normal: Simulator:

2017-08-22T04:39:32.623Z - normal: Simulator: Stack: [23]</_mouseMoveHandler@C:/CocosCreator/resources/cocos2d-x/simulator/win32//src/jsb_polyfill.js:5957:25

2017-08-22T04:39:32.623Z - normal: Simulator: cc.EventListenerMouse.prototype.onMouseMove@C:/CocosCreator/resources/cocos2d-x/simulator/win32//script/jsb_cocos2d.js:315:5

2017-08-22T04:39:32.623Z - normal: Simulator:

2017-08-22T04:39:32.624Z - normal: Simulator:

2017-08-22T04:39:32.640Z - normal: Simulator: JS Exception: _currentHovered._mouseListener is null, file: C:/CocosCreator/resources/cocos2d-x/simulator/win32//src/jsb_polyfill.js, lineno: 5957

2017-08-22T04:39:32.642Z - normal: Simulator:

2017-08-22T04:39:32.643Z - normal: Simulator: Stack: [23]</_mouseMoveHandler@C:/CocosCreator/resources/cocos2d-x/simulator/win32//src/jsb_polyfill.js:5957:25

2017-08-22T04:39:32.643Z - normal: Simulator: cc.EventListenerMouse.prototype.onMouseMove@C:/CocosCreator/resources/cocos2d-x/simulator/win32//script/jsb_cocos2d.js:315:5

2017-08-22T04:39:32.643Z - normal: Simulator:

2017-08-22T04:39:32.644Z - normal: Simulator:

切换几次场景以后突然出现这个,点击所有界面没有反应,偶现的.不知道怎么重现.

朋友,你是回复我的? 感觉是同一个问题

http://forum.cocos.com/t/1-6-xmlhttprequest/50080/3

这个问题在1.6.1 beta.2+Windows10上仍然存在。

http://forum.cocos.com/t/1-5-1/48152?u=111923
1.6版本 图片编译的问题似乎还是没有解决。。。
还是会卡死。。

iOS真机测试,不再黑屏了,但是没有触发jscallback。
在网页中触发scheme,没有触发jscallback,但是却触发了webveiw的onWebFinishLoaded加载回调函数,每次都打印:webview load status: [object Object] is loading!
webview load status: [object Object] load error!
http://forum.cocos.com/t/cocos-creator-webview-jscallback/49264/27
这里有demo

加载回调函数:
onWebFinishLoaded:function(sender,event){
var loadStatus=’…’
if (event === cc.WebView.EventType.LOADED) {
loadStatus= " is loaded!";
if(this.title){
this.title.string=this.conf.name;
this.status.string=’’;
this.loading.active=false;
cc.audioEngine.stopAll();
//
}
} else if (event === cc.WebView.EventType.LOADING) {
loadStatus = " is loading!";
if(this.title){
this.title.string=‘正在加载…’;
}
} else if (event === cc.WebView.EventType.ERROR) {
loadStatus = ’ load error!’;
if(this.title){
this.title.string=‘加载错误’;
}
}
//if(this.status)
//this.status.string=loadStatus;

    console.log('webview load status:',this.status,loadStatus);
},

麻烦官方帮忙确认下这功能在1.6.1版可用么?是否把前些天的相关代码合并进来了?
安卓真机测试,网页跳转了,显示网页无法打开,net:ERR_UNKNOWN_URL_SCHEME
综合iOS和安卓,应该是网页跳转了,没有识别出协议
把下面和jscallback相关的代码注释掉,安卓,网页也跳转,这太不合理了。之前注释掉的话,iOS不会尝试不会跳转,安卓的没试。
官方大神帮忙回复下吧,关注这个功能很久了,也积极的配合了官方技术,也耐心的等待了新版本。
为什么新版本发布之前不测试通过,再把解决的功能点列出来呢?理解官方很忙,但普通用户的心也很急切啊
//webview.setJavascriptInterfaceScheme(scheme);
//webview.setOnJSCallback(jsCallback);
@panda @knox

图片被裁边,特别是圆形图片

想知道这个有没有修复。很苦恼,这个问题显得游戏非常不精致。

下面这个错误是什么意思呢,我没有使用socket
nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available, dumping backtrace:
[x86_64] libnetcore-856.30.16
0 libsystem_network.dylib 0x000000010aeb8666 __nw_create_backtrace_string + 123
1 libnetwork.dylib 0x000000010aaad006 nw_socket_add_input_handler + 3164
2 libnetwork.dylib 0x000000010aa8a555 nw_endpoint_flow_attach_protocols + 3768
3 libnetwork.dylib 0x000000010aa89572 nw_endpoint_flow_setup_socket + 563
4 libnetwork.dylib 0x000000010aa88298 -[NWConcrete_nw_endpoint_flow startWithHandler:] + 2612
5 libnetwork.dylib 0x000000010aaa3ae1 nw_endpoint_handler_path_change + 1261
6 libnetwork.dylib 0x000000010aaa3510 nw_endpoint_handler_start + 570
7 libdispatch.dylib 0x000000010ac35978 _dispatch_call_block_and_release + 12
8 libdispatch.dylib 0x000000010ac5f0cd _dispatch_client_callout + 8
9 libdispatch.dylib 0x000000010ac3ce17 _dispatch_queue_serial_drain + 236
10 libdispatch.dylib 0x000000010ac3db4b _dispatch_queue_invoke + 1073
11 libdispatch.dylib 0x000000010ac40385 _dispatch_root_queue_drain + 720
12 libdispatch.dylib 0x000000010ac40059 _dispatch_worker_thread3 + 123
13 libsystem_pthread.dylib 0x000000010b0084de _pthread_wqthread + 1129
14 libsystem_pthread.dylib 0x000000010b006341 start_wqthread + 13