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

每次打包出来的settings文件中 bundleVers的main字段都不一样。但是我是连续两次构建测试,没有任何改动

这个原因是因为安卓原生没有触发旋转事件,导致 safeArea 没有重新计算区域,已经给相关人员提 issue 了,会经快修复

那麻烦比对下 main bundle 的 config.json 和 index.js 文件,看是不是前一次有什么不同,main 的 md5 是根据这两个文件生成的

config.xxx.json 和index.xxx.js 两次的名字不一样。index.xxx.js两次文件内容一样,config.xxx.json的packs.versions.native有一段不一样

这个是个什么资源呢?能到native目录下找到对应的资源看看

热更新文件 project.manifest,每次做版本,确实 assets目录下的project.manifest都会改变。但是以前2.2.2也是这样,没问题啊 (做版本会重新生成 project.manifest version.manifest)

你能在 main 的 native 目录下搜索一下 f3223,看看是什么资源么?

文件名的话只有这个
文件内容的话没有

这个manifest 文件是什么东西?热更新生成的?两次构建的时候,内容有区别么?

manifest是 https://docs.cocos.com/creator/manual/zh/advanced-topics/hot-update.html 这个文档里面写的

内容有区别,里面的md5两次都不一样

构建完毕后, 生成 mainfest, 替换掉构建好的 mainifest 文件.

原来用 1.9.3 版本, 构建后的 manifest 文件依然在构建目录的assets 下面.

在2.4版本测试发现 构建后的 manifest 放到资源文件夹的子文件了 ,而且文件名也变了.

你需要查找到构建后的 mainiest 文件, 使用热更新工具生成的 mainifest替换.

或者用热更新工具生成的manifest 替换项目的 manifest , 然后再构建一遍.

1赞

同一个工程,什么资源都没改动的情况,执行两次manifest生成,md5的结果会不一样?你说的是这样的情况?

试了一下,连续两次构建,或者连续两次manifest生成都是一致的。我之前的流程是构建-生成manifest;再构建-再生成manifest。我知道了,manifest改变导致了下次构建的结果变化,又继续导致了之后的manifest,如此循环。另外,2.2.2以前的版本settings是固定叫settings.js。现在的版本是动态变化的settings.xxx.js吧?之前我们会在build-templates/jsb-link/下放一个加了热更新逻辑的main.js,现在就不能这么搞了,main.js也得动态变

因为勾选了md5-cache所以settings.js名字才会变化

把高亮这行改为 ResizeLayout , mFrameLayout 声明也修改一下.

文件路径
jsb-default\frameworks\cocos2d-x\cocos\platform\android\java\src\org\cocos2dx\lib\

ResizeLayout .java

/****************************************************************************
 Copyright (c) 2010-2013 cocos2d-x.org
 Copyright (c) 2013-2016 Chukong Technologies Inc.

 http://www.cocos2d-x.org

 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
 in the Software without restriction, including without limitation the rights
 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the Software is
 furnished to do so, subject to the following conditions:

 The above copyright notice and this permission notice shall be included in
 all copies or substantial portions of the Software.

 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
 ****************************************************************************/
package org.cocos2dx.lib;

import android.content.Context;
import android.os.Handler;
import android.util.AttributeSet;
import android.widget.FrameLayout;

public class ResizeLayout extends FrameLayout {
    private  boolean mEnableForceDoLayout = false;

    public ResizeLayout(Context context){
        super(context);
    }

    public ResizeLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public void setEnableForceDoLayout(boolean flag){
        mEnableForceDoLayout = flag;
    }

    @Override
    protected void onLayout(boolean changed, int l, int t, int r, int b) {
        super.onLayout(changed, l, t, r, b);
        if(mEnableForceDoLayout){
            /*This is a hot-fix for some android devices which don't do layout when the main window
            * is paned.  We refresh the layout in 24 frames per seconds.
            * When the editBox is lose focus or when user begin to type, the do layout is disabled.
            */
            final Handler handler = new Handler();
            handler.postDelayed(new Runnable() {
                @Override
                public void run() {
                    //Do something after 100ms
                    requestLayout();
                    invalidate();
                }
            }, 1000 / 24);

        }
    }
}


根据1.9.3 修改的. 目前看没有问题

在场景中创建一个Button,修改Background的尺寸,然后点击Resize to Target, Button的尺寸异常,不是跟Background的一致

嗯,目前默认的设计是 background 的尺寸跟随 button 节点的尺寸,这点可能跟 resizeToTarget 冲突了
直接调整 button 节点的尺寸就好了,我们给 background 节点加了锁,就是不希望直接修改 background 的尺寸
如果需要这么做,建议先把 background 节点的 widget 组件移除

npm安装的模块, 当bundle代码打包成子包时,全部找不到node_module里的模块

你先在主包中引用吧~

大佬们,难道是我使用姿势不对吗?:joy:

映射为runtime-resource的项目B,其自身是个完整的独立项目呢。
自动图集是单独打开项目B的时候配置的。