Cocos Creator v2.3.1 released!

Cocos Creator v2.3.1 released!
0

Cocos Creator v2.3.1 Released!

Cocos Creator v2.3.1 is officially released. v2.3.1 is a a bug fix release that aims to fix defects and improve stability. It is recommended that all developers upgrade! Please perform the necessary technical evaluation and backups before upgrading.

Downloads

MacOS

Windows

Improvements

  • Adapted for WeChat PC game [#87]
  • Further optimize engine package size on mini-games and web platforms
  • Improve API documentation and creator.d.ts declaration
  • Added support for TiledMap Object layer Top-Down and Manual rendering order and horizontal and vertical flip (thanks @大城小胖) [#6157]
  • Support using Backspace button to delete nodes in the scene
  • Lock built-in resources to avoid misuse
  • Disable evalString calls in native non-JS threads to avoid V8 crashes

Editor

  • Fixed the issue that npm module cannot be used after upgrading to 2.3.0
  • Fixed an issue where VS Code could not break after upgrading to 2.3.0
  • After upgrading to 2.3.0, it may cause the script to depend on the cycle and an “TypeError: Object prototype may only be an Object or null” error occurs.
  • Fixed the problem that plugin path may be wrong when building only scripts on Windows platform (thanks to shengyong)
  • Fixed the problem of incomplete node display after importing some models (thanks C_Tsang)
  • Fixed the issue that Spine binary files cannot be uploaded on WeChat mini games
  • Fixed the issue that the signing certificate generated by Xiaomi to the default path will be deleted during the build

Engine

  • [Core] Optimize the initialization process when dynamically creating Label nodes [#6173]
  • [Core] Fixed the problem that dynamically modifying the material in Prefab will cause other same materials to be changed [#6201]
  • [Core] Fix the rendering level problem that may be caused by repeatedly setting zIndex repeatedly (thanks @大城小胖) [#6227]
  • [Core] Fixed the issue that the EditBox input box was misplaced after the CanWidth component was checked for fitWidth [#6233]
  • [Core] Fix RichText’s modification and typographical errors when active is false [#6231]
  • [Core] Fix the first Burst display of 3D particles is incorrect. [#6269]
  • [Native] Fix the error caused by destroying Mask in event callback [#6186]
  • [Native] Fixed the problem of invalid material switching technology (thanks inkfood.com) [#250]
  • [Native] Fix incorrect width and height obtained after window size change [#249]
  • [Native] Fix the problem that the widget is not updated after the window size is changed [#6224]
  • [Native] Fix JS native debugging cannot use Performance and Profiler [#2186]
  • [Native] Fix Editbox clicking soft keyboard to collapse triangle, did not trigger edit completion event
  • [Native] Fix memory leak when restarting the game [#2215]
  • [Native] Fix the problem that the Android audio module will prevent the device from entering the power saving mode after entering the background [#2137]
  • [Native] Fix window adaptive problem when split screen in Android [#2142]
  • [Native] Fix window size error after Windows platform restart [#2129]
  • [HTML] Fixed the problem that audio cannot be played when safari returns to the game from the background [#6198]
  • [Mini game] Fix the problem that Audio is not destroyed [#6221]

Known issues

  • An error can occur when importing a Cocos Studio project in v2.3.1. This issue will be fixed in v2.3.2. Developers can temporarily import projects in the old version editor if needed, and then upgrade to v2.3.1 for use.

Upgrade Tips

Upgrading a project from a previous version of Cocos Creator is irreversible. Please backup the old version of the project before upgrading.

Projects under development can usually be upgraded seamlessly, but because of the uniqueness of each project, developers should conduct a technical evaluation based on their project’s own needs. If developers encounter difficulties in upgrading, please feel free to give us feedback and we will try our best to assist. In addition, due to stability considerations, it is recommended that projects that are about to be launched or already launched be upgraded with caution.

Upgrade from < v2.3.0 version

If an “Can not find module.module for path…” loading warning occurs:

After upgrading to 2.3, this warning may be due to the stricter case detection of the import/require paths in the script. In the old version, if the case of the path does not match the actual file, there may be some potential errors which may not be manifested. We recommend that projects experiencing this issue correct the capitalizations.

Since v2.3.0, Android and Android Instant use the same build template, please note:

  • If the code is used solely by the Android platform, please put it in the app/src directory, and the third-party library used by itself, please put it in theapp/libs directory.

  • If the code and third-party libraries used by Android Instant are separate, please put them in the game/src, game/libs directories.

  • For code and third-party libraries shared by Android and Android Instant, please place them in the src and libs directories under the proj.android-studio root directory, respectively.

  • proj.android-studio under the root directory jni/CocosAndroid.mk, jni/CocosApplication.mk, mainly used to configure engine-related configuration, developer configuration, it is recommended that Android be placed in app/jni/Android.mk and app/jni/Application.mk, Android Instant Please put in game/jni/Android.mk and game/jni/Application.mk.

When Cocos Creator compiles Android, it will execute assembleRelease/Debug by default, and when compiling Android Instant, it will execute instant: assembleRelease/Debug.

Upgrade from version v2.0 - v2.3.0

Starting from 2.3.0, the Canvas component is no longer responsible for setting the Canvas node size to the screen size. This behavior will be implemented in conjunction with the Widget component. To ensure compatibility, after the 2.0 project is upgraded, the node where Canvas is located will automatically add Widget components. (No problem upgrading from a 1.0 project)

Upgrade from < v2.2.0

Starting from 2.2.0, we have strengthened the memory management mechanism, and now require users to dynamically create cc.Node which is independent of the scene node tree through code must be released through destroy(), otherwise the engine cannot know when to recycle this type The memory of the node will cause a memory leak.

  • In addition, the nodes that are manually removed from the scene need to be unified when they are not needed.

    // Assuming testNode is a node in the scene, if it was manually removed from the scene before, such as
    testNode.parent = null;
    // or
    testNode.removeFromParent(true);
    // or
    parentNode.removeChild(testNode);
    // If testNode will be used again in the future, there is no need to manually destroy the node
    // otherwise it should be called manually
    testNode.destroy();
    
  • If a node is managed via cc.NodePool, it is not affected.

Upgrade from <v2.0

If you open the 1.x project, all resources such as scenes will be upgraded automatically. If there are warnings or errors in the code, you can refer to v1.10.0 Resource Upgrade Guide and the v2.0.0 Upgrade Documentation.

2 Likes

what do you mean?
this works yet inside android studio?

app.runOnGLThread(new Runnable() {
@Override
public void run() {
Cocos2dxJavascriptJavaBridge.evalString(“RewardedCallbackOnUnAvailable(’” + placementId + “’);”);
}
});

and this inside javascript:

                jsb.reflection.callStaticMethod("com/ghost/ads",
                                                "Initialization",
                                                "(Ljava/lang/String;Ljava/lang/String;)V",
                                                data.app_id, user);

Thanks :smiley:

Stefano

Yes, it works. We just perform some thread checking inside the evalString to help better debugging crashes.

1 Like

Thanks for the version but there is still an animation BUG that was not occur on 2.2.0 and below…

Please follow:
https://discuss.cocos2d-x.org/t/creator-v2-3-0-animation-issue/49318/31

Hello.
Thanks for new version! but i got some problem.
After upgrade from 2.2.0, size of nodes that has sprite component with sliced type in project are reverted to raw texture size.
Upgrade to 2.2.2 is ok.
Can i solve this? Thanks for your help!

Please help!

i can’t compile android even with hello world exam:

Parsing D:\android\sdk\sources\android-21\package.xml
Parsing D:\android\sdk\sources\android-23\package.xml
Parsing D:\android\sdk\sources\android-26\package.xml
Parsing D:\android\sdk\sources\android-29\package.xml
SDK initialized in 684 ms

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring project ‘:game’.

java.lang.NullPointerException (no error message)

Are you using 2.3.1? What is your setup?

Yes, i’m using v2.3.1, jdk 1.8, sdk 23, ndk 18. Open creator, create new hello world project, build success but get null pointer error when compiling

@jare, can you take a look at the posts from @kkk96 please.

Issue after migrating from v.2.2.1 to v.2.3.1. Please help!

After migratiing my project from v.2.2.1 to v.2.3.1, migration folder was created under assets/.
Inside the folder there was a js file named “use_v2.1-2.2.1_cc.Toggle_event”. Below is the code.

/*
 * This script is automatically generated by Cocos Creator and is only used for projects compatible with the v2.1.0 ~ 2.2.1 version.
 * You do not need to manually add this script in any other project.
 * If you don't use cc.Toggle in your project, you can delete this script directly.
 * If your project is hosted in VCS such as git, submit this script together.
 *
 * 此脚本由 Cocos Creator 自动生成,仅用于兼容 v2.1.0 ~ 2.2.1 版本的工程,
 * 你无需在任何其它项目中手动添加此脚本。
 * 如果你的项目中没用到 Toggle,可直接删除该脚本。
 * 如果你的项目有托管于 git 等版本库,请将此脚本一并上传。
 */

if (cc.Toggle) {
    // Whether to trigger 'toggle' and 'checkEvents' events when modifying 'toggle.isChecked' in the code
    // 在代码中修改 'toggle.isChecked' 时是否触发 'toggle' 与 'checkEvents' 事件
    cc.Toggle._triggerEventInScript_isChecked = true;
}

Will it be necessary to keep this file for my project?
I want my project to work properly without this file and also the migration folder.
How should I fix my code that is using cc.Toggle component in order to do that?
My project is going to use Cocos Creator v2.3.1 from now on and the same goes
to all my teammates who are also working on this project. I’d appreciate it if I could
get a guideline on how to get rid of the migration folder.

Thanks :laughing:
Hongyeol