-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Crashed with Android 4.4.2 #16229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The crash stack seems to say nothing. :( |
The attachment url is broken. |
@dumganhar |
I don't have a 4.4.2 device. But it works on Android 4.4.4. |
@Drakon-Cocos, the attachment still could not be downloaded. please check it again. |
@dumganhar |
Thanks. It could be downloaded. |
@dumganhar
The program crashes always when try to preload the second sound:
Here the full
|
It looks like you were using About how to switch to gcc, you could modify (cocos2d-x/tools/cocos2d-console/plugins/plugin_compile/build_android.py), search def get_toolchain_version(self, ndk_root, compile_obj):
return 'clang' # --> '4.8' or '4.9' |
@dumganhar
When I start |
I have no idea about @minggo ,any thoughts about @Drakon-Cocos posted above? |
@Drakon-Cocos will you please use latest github codes and try again? |
@minggo EDIT: have you switched to |
I found out some interesting things:
|
Yep, we found clang+gnustl_static may cause crash issues. |
Cocos2dxHelper.java int sampleRate = 44100;
int bufferSizeInFrames = 192;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { // API 17
AudioManager am = (AudioManager) activity.getSystemService(Context.AUDIO_SERVICE);
String strSampleRate = am.getProperty(AudioManager.PROPERTY_OUTPUT_SAMPLE_RATE);
String strBufferSizeInFrames = am.getProperty(AudioManager.PROPERTY_OUTPUT_FRAMES_PER_BUFFER);
sampleRate = Integer.parseInt(strSampleRate);
bufferSizeInFrames = Integer.parseInt(strBufferSizeInFrames);
Log.d(TAG, "sampleRate: " + sampleRate + ", framesPerBuffer: " + bufferSizeInFrames);
} else {
Log.d(TAG, "android version is lower than " + Build.VERSION_CODES.JELLY_BEAN_MR1);
}
Cocos2dxActivity.java protected void hideVirtualButton() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { // API 19
getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar
| View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
}
} @minggo , therefore, we need to change API 21 to API 19 |
@minggo But, the game crashed at IdeaTab (x86), previous version with clang is OK. clang+gnustl_static will cause arm to crash, and gcc +gnustl_static will cause x86 to crash? saddly story... |
@ryanxia2016 please use gcc 4.9. |
@dumganhar ok, i will change to 19. |
I changed to api 19 in #16248 |
Oh, we need api 21 to fix compiling issue if using api lever 21+. Detail information can refer to #15891. @Drakon-Cocos did you fix the issue if using gcc+api21? |
@minggo
|
@minggo is any document describe the key difference between 4.8 / 4.9 and clang? |
@ryanxia2016 No, there is not a document. Is there any crash log? What's you engine version? Can @Drakon-Cocos It is strange. I will try to find |
@minggo |
@minggo I will try later. |
@minggo |
@Drakon-Cocos you said it is Android OS related, not device related? I will try to find a device with Android 4.4.2. |
Yep, i can reproduce it, the error says |
Can not resolve it just replace |
fixed in #16248, use api 19 |
Uh oh!
There was an error while loading. Please reload this page.
I'm testing the v3 branch because it include @dumganhar's #15875 audio patch for Android.
However with a simple test project I noticed that app crashes when uses
AudioEngine
.I had the problem only with Android 4.4.2 for now (Android 5, 6 seems ok).
This is my sample project:
AudioCrashTest_mirror.zip
It is a slight modification of
cpp_empty_test
Finally this is my crash dump:
Steps to Reproduce:
AudioCrashTest.zip
The text was updated successfully, but these errors were encountered: