When compiling for Android, the preprocessor defines for byte order are
are not included in the sys/param.h chain. By including sys/endian.h we
we can ensure that the necessary macros are included.
It is especially important that endian-ness is correctly detected as the
node render order uses this information to sort #16262. Without this
fix, nodes will be rendered in the incorrect order on 64-bit Android
devices (on 32-bit, a different algorithm is used that is not
sensitive to byte order).
* fixed#18474: Provides an interface for getting SafeArea
* Adds getSafeAreaRect test demo in cpp-empty-test.
* @available(iOS 11.0, *) isn't supported in Xcode8. So we use the old way.
* Updated android build process to use c++_static
* Comment out org.gradle.jvmargs
* Updated all project in test directory
* Update C++ Template
* Update js and lua projects
* Update Proguard + Lower minSdkVersion to 14
* Added All PROP_* values + updated build.gradle
* Updated versions
* Bug in mp3reader.cpp
This directive #include <string.h> is used for memset(b, c, l).
Without it the attemt to install .apk (ex. cocos run . -p android --android-studio) is creshed.
Found in the downloaded from http://cocos2d-x.org/download version cocos2d-x-3.16
* #include <string.h> added to avoid crash
The directive #include <string.h> is used for memset(b, c, l).
Without it the attempt to install .apk (ex. cocos run . -p android --android-studio) is crashed.
Found in the downloaded from http://cocos2d-x.org/download version cocos2d-x-3.16:
Here part of log:
In file included from C:/Users/Vadim/Documents/Cocos2d/TestAndroidGame2/frameworks/cocos2d-x/cocos/./base/allocator/CCAllocatorGlobalNewDelete.cpp:27:0:
C:/Users/Vadim/Documents/Cocos2d/TestAndroidGame2/frameworks/cocos2d-x/cocos/./base/allocator/CCAllocatorStrategyGlobalSmallBlock.h: In constructor 'cocos2d::allocator::AllocatorStrategyGlobalSmallBlock::AllocatorStrategyGlobalSmallBlock()':
C:/Users/Vadim/Documents/Cocos2d/TestAndroidGame2/frameworks/cocos2d-x/cocos/./base/allocator/CCAllocatorStrategyGlobalSmallBlock.h:96:75: error: 'memset' was not declared in this scope
memset(_smallBlockAllocators, 0, sizeof(_smallBlockAllocators));
^
make: *** [C:/Users/Vadim/Documents/Cocos2d/TestAndroidGame2/frameworks/runtime-src/proj.android-studio/app/build/intermediates/ndkBuild/debug/obj/local/x86/objs-debug/cocos2dx_internal_static/base/allocator/CCAllocatorGlobalNewDelete.o] Error 1
make: *** Waiting for unfinished jobs....
:TestAndroidGame2:externalNativeBuildDebug (Thread[Task worker for ':',5,main]) completed. Took 16.425 secs.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':TestAndroidGame2:externalNativeBuildDebug'.
> Build command failed.
Error while executing process F:\android-ndk-r16\ndk-build.cmd with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\Users\Vadim\Documents\Cocos2d\TestAndroidGame2\frameworks\runtime-src\proj.android-studio\app\jni\Android.mk NDK_APPLICATION_MK=C:\Users\Vadim\Documents\Cocos2d\TestAndroidGame2\frameworks\runtime-src\proj.android-studio\app\jni\Application.mk APP_ABI=x86 NDK_ALL_ABIS=x86 NDK_DEBUG=1 APP_PLATFORM=android-21 NDK_OUT=C:/Users/Vadim/Documents/Cocos2d/TestAndroidGame2/frameworks/runtime-src/proj.android-studio/app/build/intermediates/ndkBuild/debug/obj NDK_LIBS_OUT=C:\Users\Vadim\Documents\Cocos2d\TestAndroidGame2\frameworks\runtime-src\proj.android-studio\app\build\intermediates\ndkBuild\debug\lib NDK_TOOLCHAIN_VERSION=4.9 APP_PLATFORM=android-26 NDK_MODULE_PATH=C:/Users/Vadim/Documents/Cocos2d/TestAndroidGame2/frameworks/cocos2d-x;C:/Users/Vadim/Documents/Cocos2d/TestAndroidGame2/frameworks/cocos2d-x/cocos;C:/Users/Vadim/Documents/Cocos2d/TestAndroidGame2/frameworks/cocos2d-x/external -j4 NDK_DEBUG=1 C:/Users/Vadim/Documents/Cocos2d/TestAndroidGame2/frameworks/runtime-src/proj.android-studio/app/build/intermediates/ndkBuild/debug/obj/local/x86/libcocos2djs.so}
[x86] Compile++ : audioengine_static <= mp3reader.cpp
[x86] Compile++ : cocos2dx_internal_static <= CCAllocatorGlobalNewDelete.cpp
In file included from C:/Users/Vadim/Documents/Cocos2d/TestAndroidGame2/frameworks/cocos2d-x/cocos/./base/allocator/CCAllocatorGlobalNewDelete.cpp:27:0:
C:/Users/Vadim/Documents/Cocos2d/TestAndroidGame2/frameworks/cocos2d-x/cocos/./base/allocator/CCAllocatorStrategyGlobalSmallBlock.h: In constructor 'cocos2d::allocator::AllocatorStrategyGlobalSmallBlock::AllocatorStrategyGlobalSmallBlock()':
C:/Users/Vadim/Documents/Cocos2d/TestAndroidGame2/frameworks/cocos2d-x/cocos/./base/allocator/CCAllocatorStrategyGlobalSmallBlock.h:96:75: error: 'memset' was not declared in this scope
memset(_smallBlockAllocators, 0, sizeof(_smallBlockAllocators));
^
make: *** [C:/Users/Vadim/Documents/Cocos2d/TestAndroidGame2/frameworks/runtime-src/proj.android-studio/app/build/intermediates/ndkBuild/debug/obj/local/x86/objs-debug/cocos2dx_internal_static/base/allocator/CCAllocatorGlobalNewDelete.o] Error 1
make: *** Waiting for unfinished jobs....
* Uses Images.xcassets instead of several icon png files.
* Renames AppIcon.
* Sets AppIcon from Images.xcassets
* Uses Images.xcassets instead of several icon png files for template projects.
* Modify permission to 644
If the last search path is _defaultResRootPath, addSearchPath(path) should not force that the last path is still default resource root path.
I made this mistake and broke the compatibiliy, since I thought resource root path definitely is low priority while search in most case. However, I should not make this assumption.
Anyway, dear developers, thanks for all of you review cocos2d-x source code. I accept any suggestion, any blame. I think everyone makes mistake more or less.
The key point is that `PLEASE DON'T MAKE THE SAME MISTAKE SECOND TIME, THIRD TIME`.
So please don't blame our developers who makes mistakes. We need to work together with all our developers to make our engine better and better.
And in fact, I never think that I deal with cocos2d-x source code as my 'own branch' although I contributed lots of code to it. I didn't push any code to repo directly since I sent Pull Requests. Every one could review code and comment in pull request. We encourage more communication with our developers in github or the forum. You could say GOOD , BAD or SHIT, but please do your best to respect every developer who made a contribution.
Thanks all of you. Good luck!