gpt4 book ai didi

基于 cocos2dx 1.0.1 0.12.0 的 android 应用程序在第二次运行时崩溃

转载 作者:太空宇宙 更新时间:2023-11-03 13:32:07 26 4
gpt4 key购买 nike

我根据源代码中的测试项目修改了particle测试项目。更改 Cocos2dxActivity.java 文件

public static void terminateProcess(){
android.os.Process.killProcess(android.os.Process.myPid());
}

public static void terminateProcess(){
finish();
}

我在cocos2d-2.0-rc2-x-2.0.1上使用这个修改,Activity可以成功运行第二次。但是在cocos2d-1.0.1-x-0.12.0(甚至是cocos2d-1.0.1-x-0.13.0-beta)上,Activity第一次运行成功,第二次失败,第三次成功。

新 AppDelegate 上的代码失败。

void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(
JNIEnv* env, jobject thiz, jint w, jint h)
{
if (!cocos2d::CCDirector::sharedDirector()->getOpenGLView())
{
cocos2d::CCEGLView *view = &cocos2d::CCEGLView::sharedOpenGLView();
view->setFrameWidthAndHeight(w, h);
cocos2d::CCDirector::sharedDirector()->setOpenGLView(view);
//Code failed here.
AppDelegate *pAppDelegate = new AppDelegate();
cocos2d::CCApplication::sharedApplication().run();
}
else
{
cocos2d::CCTextureCache::reloadAllTextures();
cocos2d::CCDirector::sharedDirector()->setGLDefaultValues();
}
}

这里是崩溃日志

07-31 15:30:05.520: I/Adreno200-EGLSUB(134): <CreateImage:896>: Android Image
07-31 15:30:05.520: I/Adreno200-EGLSUB(134): <GetImageAttributes:1105>: RGBA_8888
07-31 15:30:05.540: V/PhoneStatusBar(435): setLightsOn(true)
07-31 15:30:05.600: D/memalloc(134): ion: Allocated buffer base:0x4239c000 size:1658880 fd:53 1000000 0
07-31 15:30:05.600: D/memalloc(803): ion: Mapped buffer base:0x5cfd1000 size:1658880 offset:0 fd:81
07-31 15:30:05.610: I/Adreno200-EGLSUB(803): <ConfigWindowMatch:2104>: Format RGB_565.
07-31 15:30:05.610: D/memalloc(134): ion: Allocated buffer base:0x425f0000 size:798720 fd:60 1000000 0
07-31 15:30:05.610: D/memalloc(803): ion: Mapped buffer base:0x5d166000 size:798720 offset:0 fd:84
07-31 15:30:05.630: I/Adreno200-EGLSUB(134): <CreateImage:896>: Android Image
07-31 15:30:05.630: I/Adreno200-EGLSUB(134): <GetImageAttributes:1105>: RGBA_8888
07-31 15:30:05.640: I/ActivityManager(315): Displayed com.test.benchmark/org.cocos2dx.tests.TestsDemoV1: +167ms
07-31 15:30:05.640: D/particle(803): Enter OpenCLView
07-31 15:30:05.640: D/particle(803): Enter OpenCLView 2
07-31 15:30:05.640: D/particle(803): Enter OpenCLView 3
07-31 15:30:05.650: D/particle(803): Enter OpenCLView 4
07-31 15:30:05.650: A/libc(803): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1)
07-31 15:30:05.660: D/memalloc(803): ion: Unmapping buffer base:0x5c2d9000 size:1658880
07-31 15:30:05.660: D/memalloc(134): ion: Freeing buffer base:0x42f50000 size:1658880 fd:47
07-31 15:30:05.660: D/memalloc(134): ion: Unmapping buffer base:0x42f50000 size:1658880
07-31 15:30:05.660: D/memalloc(803): ion: Unmapping buffer base:0x5c56e000 size:1658880
07-31 15:30:05.990: D/memalloc(134): ion: Freeing buffer base:0x4315c000 size:1658880 fd:56
07-31 15:30:05.990: D/memalloc(134): ion: Unmapping buffer base:0x4315c000 size:1658880
07-31 15:30:06.000: V/AudioHardwareMSM8660(137): AudioStreamOutMSM72xx::write(0x1c918, 4800) dev = speaker_stereo_rx
07-31 15:30:06.160: I/DEBUG(30740): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
07-31 15:30:06.160: I/DEBUG(30740): Build fingerprint: 'Xiaomi/mione_plus/mione_plus:4.0.4/IMM76D/2.7.20:user/release-keys'
07-31 15:30:06.160: I/DEBUG(30740): pid: 803, tid: 921 >>> com.ludashi.benchmark <<<
07-31 15:30:06.160: I/DEBUG(30740): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadbaad
07-31 15:30:06.160: I/DEBUG(30740): r0 deadbaad r1 00000001 r2 40000000 r3 00000000
07-31 15:30:06.160: I/DEBUG(30740): r4 00000000 r5 00000027 r6 00000000 r7 581adf48
07-31 15:30:06.160: I/DEBUG(30740): r8 5ca51c10 r9 581adf40 10 00000008 fp 5ca51c24
07-31 15:30:06.160: I/DEBUG(30740): ip 00000000 sp 5ca51b90 lr 400cd4b9 pc 400c9c18 cpsr 60000030
07-31 15:30:06.160: I/DEBUG(30740): d0 3a6432736f636f63 d1 696c70704143433a
07-31 15:30:06.160: I/DEBUG(30740): d2 3a3a6e6f69746163 d3 63696c7070414343
07-31 15:30:06.160: I/DEBUG(30740): d4 0000000000000000 d5 0000000000000000
07-31 15:30:06.160: I/DEBUG(30740): d6 0000000000000000 d7 0000000000000000
07-31 15:30:06.160: I/DEBUG(30740): d8 436a000043340000 d9 43f00000000000ea
07-31 15:30:06.160: I/DEBUG(30740): d10 0000000044138000 d11 0000000000000000
07-31 15:30:06.170: I/DEBUG(30740): d12 0000000000000000 d13 0000000000000000
07-31 15:30:06.170: I/DEBUG(30740): d14 0000000000000000 d15 0000000000000000
07-31 15:30:06.170: I/DEBUG(30740): d16 64656c6961662022 d17 2220656c6966203a
07-31 15:30:06.170: I/DEBUG(30740): d18 0000000000000000 d19 0000000000000000
07-31 15:30:06.170: I/DEBUG(30740): d20 0000000000000000 d21 0000000000000000
07-31 15:30:06.170: I/DEBUG(30740): d22 0000000000000000 d23 0000000000000000
07-31 15:30:06.170: I/DEBUG(30740): d24 3f582b387b22f3c1 d25 3f6dcabc4571abc1
07-31 15:30:06.170: I/DEBUG(30740): d26 3f30837711244472 d27 3f4375429245411f
07-31 15:30:06.170: V/AudioPolicyManager(137): stopOutput() output 1, stream 1
07-31 15:30:06.170: V/AudioPolicyManagerBase(137): changeRefCount() stream 1, count 0
07-31 15:30:06.170: V/AudioPolicyManagerBase(137): getNewDevice() selected device 0
07-31 15:30:06.170: V/AudioPolicyManager(137): setOutputDevice() output 1 device 0 delayMs 0
07-31 15:30:06.170: V/AudioPolicyManager(137): setOutputDevice() setting same device 0 or null device for output 1
07-31 15:30:06.180: I/DEBUG(30740): d28 3f133abc51b768d7 d29 3f1420ec8fb87f66
07-31 15:30:06.180: I/DEBUG(30740): d30 3efb2a7074bf7ad4 d31 3ff0000000000000
07-31 15:30:06.180: I/DEBUG(30740): scr 60000012
07-31 15:30:06.360: I/DEBUG(30740): #00 pc 00017c18 /system/lib/libc.so
07-31 15:30:06.360: I/DEBUG(30740): #01 pc 0001edb4 /system/lib/libc.so (__assert2)
07-31 15:30:06.360: I/DEBUG(30740): #02 pc 0011ff4c

谁能帮我解决这个问题?我试图寻找任何固定的变更日志,但没有任何想法。谢谢。

最佳答案

Check this line: 07-31 15:30:05.650: A/libc(803): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1)trying07-31 15:30:06.000: V/AudioHardwareMSM8660(137): AudioStreamOutMSM72xx::write(0x1c918, 4800) dev = speaker_stereo_rx

你有一个异常(exception)。这不是编译错误,您正在尝试写入音频,但您无权访问。检查文件是否打开,文件是否存在等。

关于基于 cocos2dx 1.0.1 0.12.0 的 android 应用程序在第二次运行时崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11735023/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com