Cocos2d-x v3.9 released!

ok, that works, otw downloading.

thanks laser

so why in change log not stated, that you excluded sdkbox from cocos2d-x? And now it should be downloaded separately , what was reason for that?

I donā€™t know what the reasoning is.

In my game, I noticed some unexpected changes after migrating from 3.8.1 to 3.9:

  • When swiping a ui::ListView, the scrolling sometimes stops abruptly. This does not look that good and I donā€™t know how to fix it.

  • I had to make the Label::enableShadow sizes 3-4 times larger for the shadows to look like they did before.

  • Without setting InputFlag, ui::EditBox now sets uppercase on all input. Previously it was lowercase. This should either be reverted or a new InputFlag option is needed to set lowercase on input.

It is not excluded but is moved to /tools/cocos2d-console/plugins/plugin_package/ instead. It would be nice if setup.py included this location in the path.

Hello
This is GuangRi.
I am developing iOS and Android Games by using Cocos2d-x 3.2 yet. :frowning:
Recently, Iā€™ve developed a game with box2d.
It worked well on iPhone, but I am having issue with converting to Android.
When I was compiling to android, It had issue with Box2d.

What must I put in android.mk file?
I had converted to android with cocos2d-x 2.2.6.
but with 3.2 version, I donā€™t know how to do it.

Please help me.
Thanks
Best Regards,
GuangRi

if I run cocos new and look at Android.mk it contains this:

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := cocos2dcpp_shared

LOCAL_MODULE_FILENAME := libcocos2dcpp

LOCAL_SRC_FILES := hellocpp/main.cpp \
                   ../../Classes/AppDelegate.cpp \
                   ../../Classes/HelloWorldScene.cpp

LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes

# _COCOS_HEADER_ANDROID_BEGIN
# _COCOS_HEADER_ANDROID_END


LOCAL_STATIC_LIBRARIES := cocos2dx_static

# _COCOS_LIB_ANDROID_BEGIN
# _COCOS_LIB_ANDROID_END

include $(BUILD_SHARED_LIBRARY)

$(call import-module,./prebuilt-mk)

# _COCOS_LIB_IMPORT_ANDROID_BEGIN
# _COCOS_LIB_IMPORT_ANDROID_END

When I create new project with ā€œcocos newā€ in Cocos2d-x 3.2, Here is the android.mk file

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

$(call import-add-path,$(LOCAL_PATH)/../../cocos2d)
$(call import-add-path,$(LOCAL_PATH)/../../cocos2d/external)
$(call import-add-path,$(LOCAL_PATH)/../../cocos2d/cocos)

LOCAL_MODULE := cocos2dcpp_shared

LOCAL_MODULE_FILENAME := libcocos2dcpp

LOCAL_SRC_FILES := hellocpp/main.cpp \
                   ../../Classes/AppDelegate.cpp \
                   ../../Classes/HelloWorldScene.cpp

LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes

LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static

# LOCAL_WHOLE_STATIC_LIBRARIES += box2d_static
# LOCAL_WHOLE_STATIC_LIBRARIES += cocosbuilder_static
# LOCAL_WHOLE_STATIC_LIBRARIES += spine_static
# LOCAL_WHOLE_STATIC_LIBRARIES += cocostudio_static
# LOCAL_WHOLE_STATIC_LIBRARIES += cocos_network_static
# LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static


include $(BUILD_SHARED_LIBRARY)

$(call import-module,.)
$(call import-module,audio/android)

# $(call import-module,Box2D)
# $(call import-module,editor-support/cocosbuilder)
# $(call import-module,editor-support/spine)
# $(call import-module,editor-support/cocostudio)
# $(call import-module,network)
# $(call import-module,extensions)

But when I compile for android in Terminal, I am getting error with Box2d.

#ERROR
jni/../../Classes/../cocos2d/external/Box2D/Box2D.h:34:10: fatal error: 
      'Box2D/Common/b2Settings.h' file not found
#include <Box2D/Common/b2Settings.h>

In Cocos2d-x 2.2.6, I tried to compile as adding of folloing lines.

		$(LOCAL_PATH)/../../cocos2d/external \
		$(LOCAL_PATH)/../../cocos2d/external/Box2D

I think I must put some lines to compile successfully in Cocos2d-x 3.2, too.
With Auto-generated android.mk file, It doesnā€™t work to compile for Box2d Game Project.

Please help me.
Thanks

Get some build errors on blank project in Android-Studio.

Cannot resolve the following in Cocos2dxDownloader.java:

import org.apache.http.Header;
import org.apache.http.message.BasicHeader;

That classes where deprecated long time ago, now in Android 6.0 you need to include the required JAR libraries by yourself.

@Tengurek which ones do I have to include?

Itā€™s very strange that those libraries didnā€™t included by default in newly created project.

are you saying that cocos new ... and then cocos run -p android, on Android 6 fails due to missing dependencies?

Try to downloaded latest android sdkā€™s versions like 22,23,19,10,15 ā€¦

@Greenhouse
You can download them here https://hc.apache.org/downloads.cgi and you need to include in your project the httpcore-4.4.3.jar and httpclient-4.5.1.jar files.

Other option is update your framework and if you are using gradle include this your app.gradle file.

compile files('libs/org.apache.http.legacy.jar')

This files should be in Android/Sdk/platforms/android-23/optional

You can find more answers here http://stackoverflow.com/questions/31653002/how-to-use-the-legacy-apache-http-client-on-android-marshmallow

@slackmoehrle Didnā€™t try on new projects, just updating old projects, but only the Android code, not cocos code.

1 Like

@slackmoehrle, yep.

Isnā€™t it should be something that is already included into a newly created project?

Alright, I think my tablet upgrades to 6, I can spend some time trying this.

1 Like

Any plans to include the tvos support?
Thanks!

So my tablet will not upgrade to Android 6, so trying with Android Studio and an emulator.

Not until after v3.10 at leastā€¦

So v3.9 does not work with Android 6. QA is going to look at this and see if an update to v3.9 makes sense or if this is done for v3.10 which is a late December release.

1 Like