axmol/cocos/audio/android
Vadim Malckin a88ad87731 Bug in mp3reader.cpp (#18476)
* 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....
2017-11-21 16:16:25 +08:00
..
audio_utils [big refactoring] Audio latency fix for Android. Support to preload effects on Android now. (#15875) 2016-07-18 10:22:40 +08:00
cutils Fixes compilation errors for android audio module while building with x86 arch. (#18150) 2017-08-22 15:13:08 +08:00
jni Fix minor typos (#18289) 2017-09-20 09:05:00 +08:00
utils Update license to 2017 (#17362) 2017-02-14 14:36:57 +08:00
Android.mk [Android] Software decoding while preloading audio files to avoid some crashes on some specific android devices, and it’s 5x - 15x faster than the old implementation. (#17233) 2017-02-16 16:23:10 +08:00
AssetFd.cpp Update license to 2017 (#17362) 2017-02-14 14:36:57 +08:00
AssetFd.h Update license to 2017 (#17362) 2017-02-14 14:36:57 +08:00
AudioBufferProvider.h [big refactoring] Audio latency fix for Android. Support to preload effects on Android now. (#15875) 2016-07-18 10:22:40 +08:00
AudioDecoder.cpp [Android] Software decoding while preloading audio files to avoid some crashes on some specific android devices, and it’s 5x - 15x faster than the old implementation. (#17233) 2017-02-16 16:23:10 +08:00
AudioDecoder.h [Android] Software decoding while preloading audio files to avoid some crashes on some specific android devices, and it’s 5x - 15x faster than the old implementation. (#17233) 2017-02-16 16:23:10 +08:00
AudioDecoderMp3.cpp issue #17503: Avoid crash if initializing audio fails. (#17505) 2017-03-15 16:46:19 +08:00
AudioDecoderMp3.h [Android] Software decoding while preloading audio files to avoid some crashes on some specific android devices, and it’s 5x - 15x faster than the old implementation. (#17233) 2017-02-16 16:23:10 +08:00
AudioDecoderOgg.cpp issue #17503: Avoid crash if initializing audio fails. (#17505) 2017-03-15 16:46:19 +08:00
AudioDecoderOgg.h [Android] Software decoding while preloading audio files to avoid some crashes on some specific android devices, and it’s 5x - 15x faster than the old implementation. (#17233) 2017-02-16 16:23:10 +08:00
AudioDecoderProvider.cpp [Android] Software decoding while preloading audio files to avoid some crashes on some specific android devices, and it’s 5x - 15x faster than the old implementation. (#17233) 2017-02-16 16:23:10 +08:00
AudioDecoderProvider.h [Android] Software decoding while preloading audio files to avoid some crashes on some specific android devices, and it’s 5x - 15x faster than the old implementation. (#17233) 2017-02-16 16:23:10 +08:00
AudioDecoderSLES.cpp [Android] Software decoding while preloading audio files to avoid some crashes on some specific android devices, and it’s 5x - 15x faster than the old implementation. (#17233) 2017-02-16 16:23:10 +08:00
AudioDecoderSLES.h [Android] Software decoding while preloading audio files to avoid some crashes on some specific android devices, and it’s 5x - 15x faster than the old implementation. (#17233) 2017-02-16 16:23:10 +08:00
AudioDecoderWav.cpp [Android] Software decoding while preloading audio files to avoid some crashes on some specific android devices, and it’s 5x - 15x faster than the old implementation. (#17233) 2017-02-16 16:23:10 +08:00
AudioDecoderWav.h [Android] Software decoding while preloading audio files to avoid some crashes on some specific android devices, and it’s 5x - 15x faster than the old implementation. (#17233) 2017-02-16 16:23:10 +08:00
AudioEngine-inl.cpp [ci skip]fix android AudioEngine Crash (#18124) 2017-09-01 10:16:04 +08:00
AudioEngine-inl.h [ci skip]fix android AudioEngine Crash (#18124) 2017-09-01 10:16:04 +08:00
AudioMixer.cpp [big refactoring] Audio latency fix for Android. Support to preload effects on Android now. (#15875) 2016-07-18 10:22:40 +08:00
AudioMixer.h [big refactoring] Audio latency fix for Android. Support to preload effects on Android now. (#15875) 2016-07-18 10:22:40 +08:00
AudioMixerController.cpp Update license to 2017 (#17362) 2017-02-14 14:36:57 +08:00
AudioMixerController.h Update license to 2017 (#17362) 2017-02-14 14:36:57 +08:00
AudioMixerOps.h [big refactoring] Audio latency fix for Android. Support to preload effects on Android now. (#15875) 2016-07-18 10:22:40 +08:00
AudioPlayerProvider.cpp fixed #17413: [Android] AudioEngine::play2d may still wait 2 seconds if preload is too fast. (#17414) 2017-02-27 15:11:39 +08:00
AudioPlayerProvider.h [Android] Software decoding while preloading audio files to avoid some crashes on some specific android devices, and it’s 5x - 15x faster than the old implementation. (#17233) 2017-02-16 16:23:10 +08:00
AudioResampler.cpp get sdk version from java (#16546) 2016-09-12 09:49:39 +08:00
AudioResampler.h [big refactoring] Audio latency fix for Android. Support to preload effects on Android now. (#15875) 2016-07-18 10:22:40 +08:00
AudioResamplerCubic.cpp [big refactoring] Audio latency fix for Android. Support to preload effects on Android now. (#15875) 2016-07-18 10:22:40 +08:00
AudioResamplerCubic.h [big refactoring] Audio latency fix for Android. Support to preload effects on Android now. (#15875) 2016-07-18 10:22:40 +08:00
AudioResamplerPublic.h [big refactoring] Audio latency fix for Android. Support to preload effects on Android now. (#15875) 2016-07-18 10:22:40 +08:00
CCThreadPool.cpp Update license to 2017 (#17362) 2017-02-14 14:36:57 +08:00
CCThreadPool.h Update license to 2017 (#17362) 2017-02-14 14:36:57 +08:00
IAudioPlayer.h fixed #17685: [android] Audio in game couldn't be mute while a ring or a call is coming (#17686) 2017-04-13 10:44:08 +08:00
ICallerThreadUtils.h Update license to 2017 (#17362) 2017-02-14 14:36:57 +08:00
IVolumeProvider.h Update license to 2017 (#17362) 2017-02-14 14:36:57 +08:00
OpenSLHelper.h Update license to 2017 (#17362) 2017-02-14 14:36:57 +08:00
PcmAudioPlayer.cpp fixed #17922: [android] AudioEngine may crash while audio's over and stop state is triggered at the same time. (#17923) 2017-06-13 17:44:04 +08:00
PcmAudioPlayer.h fixed #17685: [android] Audio in game couldn't be mute while a ring or a call is coming (#17686) 2017-04-13 10:44:08 +08:00
PcmAudioService.cpp Update license to 2017 (#17362) 2017-02-14 14:36:57 +08:00
PcmAudioService.h Update license to 2017 (#17362) 2017-02-14 14:36:57 +08:00
PcmBufferProvider.cpp Update license to 2017 (#17362) 2017-02-14 14:36:57 +08:00
PcmBufferProvider.h Update license to 2017 (#17362) 2017-02-14 14:36:57 +08:00
PcmData.cpp Update license to 2017 (#17362) 2017-02-14 14:36:57 +08:00
PcmData.h Update license to 2017 (#17362) 2017-02-14 14:36:57 +08:00
Track.cpp fixed #17685: [android] Audio in game couldn't be mute while a ring or a call is coming (#17686) 2017-04-13 10:44:08 +08:00
Track.h fixed #17685: [android] Audio in game couldn't be mute while a ring or a call is coming (#17686) 2017-04-13 10:44:08 +08:00
UrlAudioPlayer.cpp fixed #17685: [android] Audio in game couldn't be mute while a ring or a call is coming (#17686) 2017-04-13 10:44:08 +08:00
UrlAudioPlayer.h fixed #17685: [android] Audio in game couldn't be mute while a ring or a call is coming (#17686) 2017-04-13 10:44:08 +08:00
audio.h Update license to 2017 (#17362) 2017-02-14 14:36:57 +08:00
ccdandroidUtils.cpp Update license to 2017 (#17362) 2017-02-14 14:36:57 +08:00
ccdandroidUtils.h Update license to 2017 (#17362) 2017-02-14 14:36:57 +08:00
cddSimpleAudioEngine.cpp Update license to 2017 (#17362) 2017-02-14 14:36:57 +08:00
mp3reader.cpp Bug in mp3reader.cpp (#18476) 2017-11-21 16:16:25 +08:00
mp3reader.h [Android] Software decoding while preloading audio files to avoid some crashes on some specific android devices, and it’s 5x - 15x faster than the old implementation. (#17233) 2017-02-16 16:23:10 +08:00
tinysndfile.cpp [Android] Software decoding while preloading audio files to avoid some crashes on some specific android devices, and it’s 5x - 15x faster than the old implementation. (#17233) 2017-02-16 16:23:10 +08:00
tinysndfile.h [Android] Software decoding while preloading audio files to avoid some crashes on some specific android devices, and it’s 5x - 15x faster than the old implementation. (#17233) 2017-02-16 16:23:10 +08:00