Cocos Creator v2.4.3-rc.7 测试帖(正式版已发)

下面这个崩溃有解吗?
(XMLHttpRequest::onResponse(cocos2d::network::HttpClient*, cocos2d::network::HttpResponse*)+1624)
挺多的都是XMLHttpRequest::onResponse

发生时间:昨天, 下午8:45,应用版本:11
Huawei HUAWEI Y6 Pro 2019 (HWMRD-M1), 2816MB RAM, Android 9
报告 1(共 5 页)

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 0 >>> com.xxx.yyy <<<

backtrace:
  #00  pc 0000000000b4ef4e  /data/app/com.xxx.yyy-lFicTHWMDJmEAuUZPUkKAA==/lib/arm/libcocos2djs.so (v8::Object::Has(v8::Local<v8::Context>, v8::Local<v8::Value>)+342)
  #01  pc 000000000061270c  /data/app/com.xxx.yyy-lFicTHWMDJmEAuUZPUkKAA==/lib/arm/libcocos2djs.so (se::Object::getProperty(char const*, se::Value*)+168)
  #02  pc 0000000000609fe8  /data/app/com.xxx.yyy-lFicTHWMDJmEAuUZPUkKAA==/lib/arm/libcocos2djs.so
  #03  pc 0000000000604c58  /data/app/com.xxx.yyy-lFicTHWMDJmEAuUZPUkKAA==/lib/arm/libcocos2djs.so (XMLHttpRequest::onResponse(cocos2d::network::HttpClient*, cocos2d::network::HttpResponse*)+1672)
  #04  pc 00000000006b3194  /data/app/com.xxx.yyy-lFicTHWMDJmEAuUZPUkKAA==/lib/arm/libcocos2djs.so
  #05  pc 000000000058e610  /data/app/com.xxx.yyy-lFicTHWMDJmEAuUZPUkKAA==/lib/arm/libcocos2djs.so (cocos2d::Scheduler::update(float)+432)
  #06  pc 0000000000569c23  /data/app/com.xxx.yyy-lFicTHWMDJmEAuUZPUkKAA==/lib/arm/libcocos2djs.so (Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeRender+506)
  #07  pc 0000000000432879  /system/lib/libart.so (art_quick_generic_jni_trampoline+40)
  #08  pc 0000000000004517  /dev/ashmem/dalvik-jit-code-cache (deleted)

第二个

发生时间:今天, 下午12:44,应用版本:11
Huawei Y9 Prime 2019 (HWSTK-HF), 3840MB RAM, Android 10
报告 1(共 2 页)

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 0 >>> com.xxx.yyy <<<

backtrace:
  #00  pc 0000000000cc6094  /data/app/com.xxx.yyy-otAxoY_qqefz8LRQAR7l1A==/lib/arm64/libcocos2djs.so (v8::Object::Has(v8::Local<v8::Context>, v8::Local<v8::Value>)+404)
  #01  pc 000000000078e6a0  /data/app/com.xxx.yyy-otAxoY_qqefz8LRQAR7l1A==/lib/arm64/libcocos2djs.so (se::Object::getProperty(char const*, se::Value*)+156)
  #02  pc 0000000000786a70  /data/app/com.xxx.yyy-otAxoY_qqefz8LRQAR7l1A==/lib/arm64/libcocos2djs.so
  #03  pc 0000000000786e74  /data/app/com.xxx.yyy-otAxoY_qqefz8LRQAR7l1A==/lib/arm64/libcocos2djs.so
  #04  pc 0000000000781dc0  /data/app/com.xxx.yyy-otAxoY_qqefz8LRQAR7l1A==/lib/arm64/libcocos2djs.so (XMLHttpRequest::onResponse(cocos2d::network::HttpClient*, cocos2d::network::HttpResponse*)+1624)
  #05  pc 0000000000820364  /data/app/com.xxx.yyy-otAxoY_qqefz8LRQAR7l1A==/lib/arm64/libcocos2djs.so
  #06  pc 00000000007156cc  /data/app/com.xxx.yyy-otAxoY_qqefz8LRQAR7l1A==/lib/arm64/libcocos2djs.so (cocos2d::Scheduler::update(float)+404)
  #07  pc 00000000006f1c10  /data/app/com.xxx.yyy-otAxoY_qqefz8LRQAR7l1A==/lib/arm64/libcocos2djs.so (Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeRender+632)
  #08  pc 0000000002001d10  /memfd:/jit-cache (art_jni_trampoline+144)
  #09  pc 00000000020067ac  /memfd:/jit-cache (org.cocos2dx.lib.Cocos2dxRenderer.onDrawFrame+476)
  #10  pc 000000000200a798  /memfd:/jit-cache (android.opengl.GLSurfaceView$GLThread.guardedRun+3976)
  #11  pc 000000000014463c  /apex/com.android.runtime/lib64/libart.so (art_quick_osr_stub+60)
  #12  pc 000000000034337c  /apex/com.android.runtime/lib64/libart.so (art::jit::Jit::MaybeDoOnStackReplacement(art::Thread*, art::ArtMethod*, unsigned int, int, art::JValue*)+1660)
  #13  pc 00000000005c5fc0  /apex/com.android.runtime/lib64/libart.so (MterpMaybeDoOnStackReplacement+212)
  #14  pc 0000000000143350  /apex/com.android.runtime/lib64/libart.so (MterpHelpers+240)
  #15  pc 00000000002fbfe8  /system/framework/framework.jar (android.opengl.GLSurfaceView$GLThread.guardedRun+1268)
  #16  pc 00000000005bd788  /apex/com.android.runtime/lib64/libart.so (MterpInvokeDirect+1168)
  #17  pc 000000000013e914  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_direct+20)
  #18  pc 00000000002fc52c  /system/framework/framework.jar (android.opengl.GLSurfaceView$GLThread.run+48)
  #19  pc 00000000002bf948  /apex/com.android.runtime/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.4040658722762997890)+240)
  #20  pc 00000000005a62c8  /apex/com.android.runtime/lib64/libart.so (artQuickToInterpreterBridge+1012)
  #21  pc 000000000014d468  /apex/com.android.runtime/lib64/libart.so (art_quick_to_interpreter_bridge+88)
  #22  pc 0000000000144334  /apex/com.android.runtime/lib64/libart.so (art_quick_invoke_stub+548)
  #23  pc 00000000001531a4  /apex/com.android.runtime/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+252)
  #24  pc 00000000004c6d18  /apex/com.android.runtime/lib64/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+104)
  #25  pc 00000000004c7dac  /apex/com.android.runtime/lib64/libart.so (art::InvokeVirtualOrInterfaceWithJValues(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, jvalue const*)+416)
  #26  pc 0000000000507d7c  /apex/com.android.runtime/lib64/libart.so (art::Thread::CreateCallback(void*)+1176)
  #27  pc 00000000000ce1b0  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36)
  #28  pc 0000000000070ba8  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)

我新建了一个demo,直接在场景中嵌套和prefab内再嵌套好像都没问题。可能是我的场景和prefab都是在2.4.3之前的版本创建的缘故吧。 资源应用确实也有点乱。我把场景和预制都在新重新做一下。感谢大神

1赞

现在也会的

这个rc4修复了哈

这个pr里面就可以看到了么

目前热更新无法更新main.js文件,勾选md5cache会导致加载的setting一直都是包内的文件,自己手动改下代码。

2赞

都改了,你可以试看看

想请问下,编辑框,如果占位符有字符串,点开后,占位符的字符变暗。这种要怎么改?

rc4 这个错误还没修复。@EndEvil @cary

2.4.3rc4 ios版本在旋转屏幕跟调用cc.game.restart()交替使用有极高机会崩溃

1赞

在creator 2.4.2 发现一个camera截图bug,生成图片的大小与RenderTexture设置的不一样,不知道在2.4.3有没有修复。
花了一个下午,找到了原因,在CCCamear里面的_onAlignWithScreen方法里面,有逻辑错误,在判断_targetTexture存在后,将相机的高度设置成visibleRect.height,而不是_targetTexture.height。

你可以看下example里面renderTexture的例子

旋转屏幕是怎么做到的?有自定义引擎吗?可否给个演示demo或者给下测试视频。

总感觉这段代码有问题,addListenner和removeListener处理的可能不是同一个callback

example里面initWithSize用的cc.visibleRect,这个是没问题的,因为在_onAlignWithScreen方法里面的height设置的就是这个值,如果换一个大小,截屏出来的纹理大小就会有问题。你可以试着截一个100x100,截出来的会比这个纹理大很多。

这个应该是早期对浏览器适配做的一个 HACK,不影响
我们验证下现在浏览器是否还存在问题,没有的话应该可以去掉了

其他尺寸的截图需要你自己计算 camera 的 orthoSize 或 fov,

类似

camera.alignWithScreen = false;
camera.orthoSize = texture.height / 2;

NewProject.zip (292.8 KB)
录制.zip (1.8 MB)

内容很单纯就一个调用restart的按钮

订制引擎的部分只有对loadBundle做一点修改,跟这段应该没关系吧?

    let targetTexture = this._targetTexture;
    if (targetTexture) {
        if (CC_EDITOR) {
            height = cc.engine.getDesignResolutionSize().height;
        }
        else {
            height = cc.visibleRect.height;
        }
    }

只需要把这段代码改成

    let targetTexture = this._targetTexture;
    if (targetTexture) {
        height = targetTexture.height;          //设置相机高度,使截图大小变化
    }

就可以了。在以前版本的引擎里面也是这样的。

请看文档:
https://docs.cocos.com/creator/manual/zh/render/camera.html#截取部分区域