Windows / Code IDE 1.2: Reload Issue

Windows / Code IDE 1.2: Reload Issue
0

Hi all:

We are using Cocos Code IDE 1.2 only for Remote Debugging and Code Live now.

Here is our issue resume:

  • Platform: Windows 10
  • Cocos2d-x: 3.8 JS
  • Project creation: cocos new runtimeTest -l js -t runtime
  • Runtime apk creation (simulator): cocos compile -p android -m debug --ap android-10 -j 3 --no-res
  • Device: Android 5.1
  • Cocos Code IDE: 1.2.0
  • Success case:
    1. Launch APK using Android ADB Mode OR Remote Debugging
    2. All (js + resources) are loaded corretly
    3. Game always starts OK
  • Failure case A: From previous success case:
    1. Modify src/app.js
    2. src/app.js is reloaded
    3. Then game always crashes. Here is the catlog output:
09-22 11:41:32.190: D/cocos2d-x debug info(8354): responseFile:src/app.js,result:0
09-22 11:41:32.226: D/cocos2d-x debug info(8354): Assert failed: reference count should be greater than 0
09-22 11:41:32.227: E/cocos2d-x assert(8354): d:\TMP\runtimeTest\frameworks\runtime-src\proj.android\../../cocos2d-x/cocos/./base/CCRef.cpp function:release line:90
09-22 11:41:32.229: D/cocos2d-x debug info(8354): Assert failed: reference count should be greater than 0
09-22 11:41:32.229: E/cocos2d-x assert(8354): d:\TMP\runtimeTest\frameworks\runtime-src\proj.android\../../cocos2d-x/cocos/./base/CCRef.cpp function:release line:90
09-22 11:41:32.238: A/libc(8354): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x3 in tid 8414 (GLThread 19734)
09-22 11:41:32.355: I/DEBUG(317): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
09-22 11:41:32.355: I/DEBUG(317): Build fingerprint: 'motorola/peregrine_retes/peregrine:5.1/LPB23.13-17/17:user/release-keys'
09-22 11:41:32.355: I/DEBUG(317): Revision: 'p2d0'
09-22 11:41:32.355: I/DEBUG(317): ABI: 'arm'
09-22 11:41:32.358: I/DEBUG(317): pid: 8354, tid: 8414, name: GLThread 19734  >>> org.cocos2dx.runtimeTest <<<
09-22 11:41:32.358: I/DEBUG(317): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x3
09-22 11:41:32.545: I/DEBUG(317):     r0 ffffffff  r1 a3e7b75c  r2 a67f6ac4  r3 ffffffff
09-22 11:41:32.545: I/DEBUG(317):     r4 b7756380  r5 dde661d2  r6 741dce38  r7 00001a79
09-22 11:41:32.545: I/DEBUG(317):     r8 00d84c51  r9 b75fb630  sl 00000000  fp a3e7b764
09-22 11:41:32.545: I/DEBUG(317):     ip b6dfd64c  sp a3e7b748  lr a5da4b58  pc a5d23d38  cpsr a00f0010
09-22 11:41:32.546: I/DEBUG(317): backtrace:
09-22 11:41:32.546: I/DEBUG(317):     #00 pc 01c9dd38  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (cocos2d::Ref::release()+20)
09-22 11:41:32.546: I/DEBUG(317):     #01 pc 01d1eb54  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (cocos2d::VolatileTexture::~VolatileTexture()+44)
09-22 11:41:32.546: I/DEBUG(317):     #02 pc 01d1f1fc  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (cocos2d::VolatileTextureMgr::removeTexture(cocos2d::Texture2D*)+160)
09-22 11:41:32.546: I/DEBUG(317):     #03 pc 01d10234  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (cocos2d::Texture2D::~Texture2D()+48)
09-22 11:41:32.547: I/DEBUG(317):     #04 pc 01d102f4  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (cocos2d::Texture2D::~Texture2D()+20)
09-22 11:41:32.547: I/DEBUG(317):     #05 pc 01c9df18  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (cocos2d::Ref::release()+500)
09-22 11:41:32.547: I/DEBUG(317):     #06 pc 01bda2ac  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (cocos2d::Sprite::~Sprite()+124)
09-22 11:41:32.547: I/DEBUG(317):     #07 pc 01bda388  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (cocos2d::Sprite::~Sprite()+20)
09-22 11:41:32.548: I/DEBUG(317):     #08 pc 01c9df18  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (cocos2d::Ref::release()+500)
09-22 11:41:32.548: I/DEBUG(317):     #09 pc 01b52a6c  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (cocos2d::Label::~Label()+308)
09-22 11:41:32.548: I/DEBUG(317):     #10 pc 01b52c0c  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (cocos2d::Label::~Label()+20)
09-22 11:41:32.548: I/DEBUG(317):     #11 pc 01c9df18  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (cocos2d::Ref::release()+500)
09-22 11:41:32.549: I/DEBUG(317):     #12 pc 00d4ce68  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (cocos2d::Vector<cocos2d::Node*>::clear()+64)
09-22 11:41:32.549: I/DEBUG(317):     #13 pc 00cef53c  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (cocos2d::Vector<cocos2d::Node*>::~Vector()+20)
09-22 11:41:32.549: I/DEBUG(317):     #14 pc 01b80e44  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (cocos2d::Node::~Node()+836)
09-22 11:41:32.549: I/DEBUG(317):     #15 pc 01b63c50  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (cocos2d::LabelTTF::~LabelTTF()+140)
09-22 11:41:32.550: I/DEBUG(317):     #16 pc 01b63ca8  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (cocos2d::LabelTTF::~LabelTTF()+20)
09-22 11:41:32.550: I/DEBUG(317):     #17 pc 01c9df18  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (cocos2d::Ref::release()+500)
09-22 11:41:32.550: I/DEBUG(317):     #18 pc 00d4ce68  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (cocos2d::Vector<cocos2d::Node*>::clear()+64)
09-22 11:41:32.550: I/DEBUG(317):     #19 pc 00cef53c  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (cocos2d::Vector<cocos2d::Node*>::~Vector()+20)
09-22 11:41:32.551: I/DEBUG(317):     #20 pc 01b80e44  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (cocos2d::Node::~Node()+836)
09-22 11:41:32.551: I/DEBUG(317):     #21 pc 01b6720c  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (cocos2d::Layer::~Layer()+52)
09-22 11:41:32.551: I/DEBUG(317):     #22 pc 01b67254  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (cocos2d::Layer::~Layer()+20)
09-22 11:41:32.551: I/DEBUG(317):     #23 pc 01c9df18  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (cocos2d::Ref::release()+500)
09-22 11:41:32.552: I/DEBUG(317):     #24 pc 00d4ce68  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (cocos2d::Vector<cocos2d::Node*>::clear()+64)
09-22 11:41:32.552: I/DEBUG(317):     #25 pc 00cef53c  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (cocos2d::Vector<cocos2d::Node*>::~Vector()+20)
09-22 11:41:32.552: I/DEBUG(317):     #26 pc 01b80e44  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (cocos2d::Node::~Node()+836)
09-22 11:41:32.552: I/DEBUG(317):     #27 pc 01bd3da0  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (cocos2d::Scene::~Scene()+316)
09-22 11:41:32.553: I/DEBUG(317):     #28 pc 01bd3de8  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (cocos2d::Scene::~Scene()+20)
09-22 11:41:32.553: I/DEBUG(317):     #29 pc 01c9df18  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (cocos2d::Ref::release()+500)
09-22 11:41:32.553: I/DEBUG(317):     #30 pc 01c6a51c  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (cocos2d::Director::setNextScene()+388)
09-22 11:41:32.553: I/DEBUG(317):     #31 pc 01c676e8  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (cocos2d::Director::drawScene()+204)
09-22 11:41:32.554: I/DEBUG(317):     #32 pc 01c6ba20  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (cocos2d::DisplayLinkDirector::mainLoop()+136)
09-22 11:41:32.554: I/DEBUG(317):     #33 pc 009e303c  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeRender+40)
09-22 11:41:32.554: I/DEBUG(317):     #34 pc 0000e5e5  /data/dalvik-cache/arm/data@app@org.cocos2dx.runtimeTest-1@base.apk@classes.dex
09-22 11:41:33.044: I/SFPerfTracer(304):      triggers: (rate: 209:6280) (compose: 0:48) (post: 0:12) (render: 59:1471) (993:278947 frames) (994:301574)
09-22 11:41:33.044: D/SFPerfTracer(304):        layers: (2:16) (FocusedStackFrame (0xb8a25780): 0:1440)* (DimLayer (0xb8a57348): 0:135)* (DimLayer (0xb8a59750): 0:6)* (DimLayer (0xb8a5c7f0): 0:959)* (DimLayer (0xb8a2cd88): 0:258)* (StatusBar (0xb8ac7118): 9:18435)* (com.android.systemui.ImageWallpaper (0xb8accf70): 0:1595)* (Sprite (0xb8ab14f8): 0:26950)* (Sprite (0xb8aa5a08): 0:13700)* (Sprite (0xb8ab8c40): 0:10119)* (Sprite (0xb8ab7370): 0:33)* (Sprite (0xb8afe128): 0:546)* (Sprite (0xb8b00648): 0:11263)* (NavigationBar (0xb8af04e0): 0:788) (org.cocos2dx.runtimeTest/org.cocos2dx.javascript.AppActivity (0xb8b05490): 0:29)* (SurfaceView (0xb8b06738): 994:1488) 
09-22 11:41:33.612: W/ActivityManager(882):   Force finishing activity 1 org.cocos2dx.runtimeTest/org.cocos2dx.javascript.AppActivity
09-22 11:41:33.620: W/InputDispatcher(882): channel '38994af2 org.cocos2dx.runtimeTest/org.cocos2dx.javascript.AppActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
09-22 11:41:33.620: E/InputDispatcher(882): channel '38994af2 org.cocos2dx.runtimeTest/org.cocos2dx.javascript.AppActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
09-22 11:41:33.627: I/WindowState(882): WIN DEATH: Window{38994af2 u0 org.cocos2dx.runtimeTest/org.cocos2dx.javascript.AppActivity}
09-22 11:41:33.630: W/InputDispatcher(882): Attempted to unregister already unregistered input channel '38994af2 org.cocos2dx.runtimeTest/org.cocos2dx.javascript.AppActivity (server)'
09-22 11:41:33.805: I/ActivityManager(882): Process org.cocos2dx.runtimeTest (pid 8354) has died
09-22 11:41:34.853: I/cm.log.servpro(3163): [Privacy]/ org.cocos2dx.runtimeTest is not in contact list
09-22 11:41:38.080: D/SFPerfTracer(304):        layers: (6:23) (FocusedStackFrame (0xb8a25780): 0:1442)* (DimLayer (0xb8a57348): 0:136) (DimLayer (0xb8a59750): 0:6)* (DimLayer (0xb8a5c7f0): 0:959)* (DimLayer (0xb8a2cd88): 0:258)* (StatusBar (0xb8ac7118): 0:18455) (com.android.systemui.ImageWallpaper (0xb8accf70): 0:1613) (Sprite (0xb8ab14f8): 0:26950)* (Sprite (0xb8aa5a08): 0:13700)* (Sprite (0xb8ab8c40): 0:10119)* (Sprite (0xb8ab7370): 0:33)* (Sprite (0xb8afe128): 0:546)* (Sprite (0xb8b00648): 0:11263)* (NavigationBar (0xb8af04e0): 0:811) (org.cocos2dx.runtimeTest/org.cocos2dx.javascript.AppActivity (0xb8b05490): 0:29)- (SurfaceView (0xb8b06738): 0:1488)- (ScreenshotSurface (0xb8a2fa28): 0:17)- (Application Error: org.cocos2dx.runtimeTest (0xb8ae80f0): 17:45) (com.android.launcher/com.android.launcher2.Launcher (0xb8af33b8): 17:37) (BlackSurface (0xb8b072d8): 0:16)- (BlackSurface (0xb8af4af0): 0:16)- (BlackSurface (0xb8af6470): 0:16)- (BlackSurface (0xb8af8878): 0:16)- 
09-22 11:42:34.495: D/SFPerfTracer(304):        layers: (7:17) (FocusedStackFrame (0xb8a25780): 0:1442)* (DimLayer (0xb8a57348): 0:136) (DimLayer (0xb8a59750): 0:6)* (DimLayer (0xb8a5c7f0): 0:959)* (DimLayer (0xb8a2cd88): 0:258)* (StatusBar (0xb8ac7118): 0:18476) (com.android.systemui.ImageWallpaper (0xb8accf70): 0:1613) (Sprite (0xb8ab14f8): 0:26950)* (Sprite (0xb8aa5a08): 0:13700)* (Sprite (0xb8ab8c40): 0:10119)* (Sprite (0xb8ab7370): 0:33)* (Sprite (0xb8afe128): 0:546)* (Sprite (0xb8b00648): 0:11263)* (NavigationBar (0xb8af04e0): 0:811) (Application Error: org.cocos2dx.runtimeTest (0xb8ae80f0): 0:45) (com.android.launcher/com.android.launcher2.Launcher (0xb8af33b8): 0:40) (ColorFade (0xb8a2fa28): 15:17) 
09-22 11:42:36.426: W/PackageManager(1398): Failure retrieving resources for org.cocos2dx.runtimeTest: Resource ID #0x0
  • Failure case B: After crash, trying to launch again using Android ADB Mode OR Remote Debugging. Note that all (js + resources) was loaded previously.
    • Game always crashes. Here is the catlog output:
09-22 11:55:04.506: I/ActivityManager(882): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=org.cocos2dx.runtimeTest/org.cocos2dx.javascript.AppActivity} from uid 2000 on display 0
09-22 11:55:04.513: V/WindowManager(882): addAppToken: AppWindowToken{1d77c0f7 token=Token{1f5884f6 ActivityRecord{2637ed91 u0 org.cocos2dx.runtimeTest/org.cocos2dx.javascript.AppActivity t3488}}} to stack=1 task=3488 at 0
09-22 11:55:04.523: V/WindowManager(882): Adding window Window{19d009d0 u0 Starting org.cocos2dx.runtimeTest} at 4 of 10 (after Window{15d0f604 u0 com.android.settings/com.android.settings.applications.InstalledAppDetails})
09-22 11:55:04.556: I/ActivityManager(882): Start proc 10649:org.cocos2dx.runtimeTest/u0a383 for activity org.cocos2dx.runtimeTest/org.cocos2dx.javascript.AppActivity
09-22 11:55:05.206: D/main(10649): cocos_android_app_init
09-22 11:55:05.391: V/WindowManager(882): Adding window Window{a300832 u0 org.cocos2dx.runtimeTest/org.cocos2dx.javascript.AppActivity} at 4 of 11 (before Window{19d009d0 u0 Starting org.cocos2dx.runtimeTest})
09-22 11:55:05.482: V/WindowManager(882): Adding window Window{4d2757e u0 SurfaceView} at 4 of 13 (before Window{a300832 u0 org.cocos2dx.runtimeTest/org.cocos2dx.javascript.AppActivity})
09-22 11:55:05.554: I/LaunchCheckinHandler(882): Displayed org.cocos2dx.runtimeTest/org.cocos2dx.javascript.AppActivity,cp,ca,1036
09-22 11:55:05.554: I/ActivityManager(882): Displayed org.cocos2dx.runtimeTest/org.cocos2dx.javascript.AppActivity: +1s36ms
09-22 11:55:05.568: I/WindowManager(882): Screen frozen for +279ms due to Window{a300832 u0 org.cocos2dx.runtimeTest/org.cocos2dx.javascript.AppActivity}
09-22 11:55:05.655: D/cocos2d-x debug info(10649): 	cocos2d.x.version: cocos2d-x-3.8
09-22 11:55:05.655: D/cocos2d-x debug info(10649): 	cocos2d.x.compiled_with_profiler: false
09-22 11:55:05.655: D/cocos2d-x debug info(10649): 	cocos2d.x.build_type: DEBUG
09-22 11:55:05.655: D/cocos2d-x debug info(10649): 	cocos2d.x.compiled_with_gl_state_cache: true
09-22 11:55:05.794: D/AutostartService(3163): set fg pkgname:org.cocos2dx.runtimeTest
09-22 11:55:05.951: D/SFPerfTracer(304):        layers: (5:23) (FocusedStackFrame (0xb8a25780): 0:1453)* (DimLayer (0xb8a57348): 0:137)* (DimLayer (0xb8a59750): 0:6)* (DimLayer (0xb8a5c7f0): 0:961)* (DimLayer (0xb8a2cd88): 0:261)* (StatusBar (0xb8ac7118): 2:18566)* (com.android.systemui.ImageWallpaper (0xb8accf70): 2:1637)* (Sprite (0xb8ab14f8): 0:26950)* (Sprite (0xb8aa5a08): 0:13700)* (Sprite (0xb8ab8c40): 0:10139)* (Sprite (0xb8ab7370): 0:33)* (Sprite (0xb8afe128): 0:546)* (Sprite (0xb8b00648): 0:11263)* (com.android.launcher/com.android.launcher2.Launcher (0xb8af33b8): 0:57)- (NavigationBar (0xb8af04e0): 2:54) (Starting org.cocos2dx.runtimeTest (0xb8a2fa28): 0:30)- (ScreenshotSurface (0xb8ae80f0): 2:22)* (org.cocos2dx.runtimeTest/org.cocos2dx.javascript.AppActivity (0xb8af33b8): 2:26)* (SurfaceView (0xb8b068f8): 2:25)* (BlackSurface (0xb8b07ba0): 2:21) (BlackSurface (0xb8af5c50): 2:21) (BlackSurface (0xb8af8058): 2:21) (BlackSurface (0xb8afa460): 2:21) 
09-22 11:55:06.359: D/cocos2d-x debug info(10649): cocos2d: fullPathForFilename: No file found at script/jsb_prepare.jsc. Possible missing file.
09-22 11:55:06.532: D/cocos2d-x debug info(10649): cocos2d: fullPathForFilename: No file found at script/jsb_debugger.jsc. Possible missing file.
09-22 11:55:06.537: D/cocos2d-x debug info(10649): cocos2d: fullPathForFilename: No file found at script/debugger/DevToolsUtils.jsc. Possible missing file.
09-22 11:55:06.542: D/cocos2d-x debug info(10649): cocos2d: fullPathForFilename: No file found at script/debugger/core/promise.jsc. Possible missing file.
09-22 11:55:06.548: D/cocos2d-x debug info(10649): cocos2d: fullPathForFilename: No file found at script/debugger/transport.jsc. Possible missing file.
09-22 11:55:06.554: D/cocos2d-x debug info(10649): cocos2d: fullPathForFilename: No file found at script/debugger/actors/root.jsc. Possible missing file.
09-22 11:55:06.559: D/cocos2d-x debug info(10649): cocos2d: fullPathForFilename: No file found at script/debugger/actors/script.jsc. Possible missing file.
09-22 11:55:06.607: D/cocos2d-x debug info(10649): cocos2d: fullPathForFilename: No file found at script/debugger/main.jsc. Possible missing file.
09-22 11:55:06.689: A/libc(10649): d:\TMP\runtimeTest\frameworks\runtime-src\proj.android\../../cocos2d-x/cocos/./../external/json/document.h:1688: bool rapidjson::GenericValue<Encoding, Allocator>::StringEqual(const rapidjson::GenericValue<Encoding, SourceAllocator>&) const [with SourceAllocator = rapidjson::MemoryPoolAllocator<>; Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>]: assertion "rhs.IsString()" failed
09-22 11:55:06.794: I/DEBUG(317): pid: 10649, tid: 10699, name: GLThread 19950  >>> org.cocos2dx.runtimeTest <<<
09-22 11:55:06.865: I/DEBUG(317): Abort message: 'd:\TMP\runtimeTest\frameworks\runtime-src\proj.android\../../cocos2d-x/cocos/./../external/json/document.h:1688: bool rapidjson::GenericValue<Encoding, Allocator>::StringEqual(const rapidjson::GenericValue<Encoding, SourceAllocator>&) const [with SourceAllocator = rapidjson::MemoryPoolAllocator<>; Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>]: assertion "rhs.IsString()" failed'
09-22 11:55:06.866: I/DEBUG(317):     #07 pc 009cc314  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (bool rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >::StringEqual<rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> > const&) const+144)
09-22 11:55:06.866: I/DEBUG(317):     #08 pc 009cbc3c  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (rapidjson::GenericMemberIterator<false, rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> > rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >::FindMember<rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> > const&)+192)
09-22 11:55:06.866: I/DEBUG(317):     #09 pc 009cb9f0  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >::FindMember(char const*)+108)
09-22 11:55:06.866: I/DEBUG(317):     #10 pc 009caf84  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >::FindMember(char const*) const+36)
09-22 11:55:06.866: I/DEBUG(317):     #11 pc 009ca96c  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >::HasMember(char const*) const+28)
09-22 11:55:06.866: I/DEBUG(317):     #12 pc 0106ea04  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (FileServer::addResFileInfo(char const*, unsigned long long)+68)
09-22 11:55:06.866: I/DEBUG(317):     #13 pc 010705d0  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (FileServer::loopWriteFile()+1036)
09-22 11:55:06.866: I/DEBUG(317):     #14 pc 0107966c  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (_ZNKSt7_Mem_fnIM10FileServerFvvEEclIJEvEEvPS0_DpOT_+124)
09-22 11:55:06.866: I/DEBUG(317):     #15 pc 01079588  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (_ZNSt5_BindIFSt7_Mem_fnIM10FileServerFvvEEPS1_EE6__callIvJEJLj0EEEET_OSt5tupleIJDpT0_EESt12_Index_tupleIJXspT1_EEE+84)
09-22 11:55:06.867: I/DEBUG(317):     #16 pc 010794c8  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (_ZNSt5_BindIFSt7_Mem_fnIM10FileServerFvvEEPS1_EEclIJEvEET0_DpOT_+36)
09-22 11:55:06.867: I/DEBUG(317):     #17 pc 01079440  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (_ZNSt12_Bind_simpleIFSt5_BindIFSt7_Mem_fnIM10FileServerFvvEEPS2_EEvEE9_M_invokeIJEEEvSt12_Index_tupleIJXspT_EEE+52)
09-22 11:55:06.867: I/DEBUG(317):     #18 pc 0107932c  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (std::_Bind_simple<std::_Bind<std::_Mem_fn<void (FileServer::*)()> (FileServer*)> ()>::operator()()+24)
09-22 11:55:06.867: I/DEBUG(317):     #19 pc 0107928c  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so (std::thread::_Impl<std::_Bind_simple<std::_Bind<std::_Mem_fn<void (FileServer::*)()> (FileServer*)> ()> >::_M_run()+28)
09-22 11:55:06.867: I/DEBUG(317):     #20 pc 021b4f9b  /data/app/org.cocos2dx.runtimeTest-1/lib/arm/libcocos2djs.so
09-22 11:55:07.834: W/ActivityManager(882):   Force finishing activity 1 org.cocos2dx.runtimeTest/org.cocos2dx.javascript.AppActivity
09-22 11:55:07.868: W/InputDispatcher(882): channel 'a300832 org.cocos2dx.runtimeTest/org.cocos2dx.javascript.AppActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
09-22 11:55:07.868: E/InputDispatcher(882): channel 'a300832 org.cocos2dx.runtimeTest/org.cocos2dx.javascript.AppActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
09-22 11:55:07.879: I/WindowState(882): WIN DEATH: Window{a300832 u0 org.cocos2dx.runtimeTest/org.cocos2dx.javascript.AppActivity}
09-22 11:55:07.879: W/InputDispatcher(882): Attempted to unregister already unregistered input channel 'a300832 org.cocos2dx.runtimeTest/org.cocos2dx.javascript.AppActivity (server)'
09-22 11:55:07.879: W/WindowManager(882): Force-removing child win Window{4d2757e u0 SurfaceView} from container Window{a300832 u0 org.cocos2dx.runtimeTest/org.cocos2dx.javascript.AppActivity}
09-22 11:55:08.015: I/ActivityManager(882): Process org.cocos2dx.runtimeTest (pid 10649) has died
09-22 11:55:09.813: I/cm.log.servpro(3163): [Privacy]/ org.cocos2dx.runtimeTest is not in contact list

I really appreciate any help you can provide.

Failure case A (HALF-SOLVED):

  • SOLUTION: Cocos Code IDE.exe > Right Click > Compatibility: Windows 7

Now don’t crash in this case, but this error is reported and js is not updated:

jsb: ERROR: File d:\TMP\runtimeTest\frameworks\runtime-src\proj.android\../../cocos2d-x/cocos/scripting/js-bindings/proj.android/../auto/jsb_cocos2dx_auto.cpp: Line: 7392, Function: js_cocos2dx_Director_replaceScene
Invalid Native Object
JS: assets/script/jsb_cocos2d.js:1644:Error: Invalid Native Object
(evaluatedOK == JS_FALSE)

sorry poor english…
my case
Problem is “tools\simulator\libsimulator\lib\runtime\FileServer.h”
member var ------------------------
rapidjson::Document _filecfgjson; <------ Problem

Always during second run Crash. - invalid json(string data type)

solution is rapidjson::Document -> ValueMap & FileUtils::getInstance()->writeValueMapToFile, getValueMapFromFile

rapidjson::Document* getFileCfgJson() { return &_filecfgjson; }
void FileServer::readResFileFinfo()
void FileServer::addResFileInfo(const char* filename, uint64_t u64)
void FileServer::removeResFileInfo(const char *filename)

I’m sorry, @comjin. I don’t understand you.

Could you attach your FileServer.h to try it, please?

Thanks!

fix.zip (10.3 KB)

Thank you @comjin. I’ve replaced my files on frameworks\cocos2d-x\tools\simulator\libsimulator\lib\runtime with your zipped files, but runtime apk is crashing now from the launch of the apk.

Then I have returned to cocos2d-js-v3.6.1 and:

  • Failure case A: Not crash, but live code doesn’t work (If I modify a js it isn’t updated in the game). Here is the output of Code IDE > Console:
responseFile:src/app.js,result:0
Assert failed: reference count should be greater than 0
Assert failed: reference count should be greater than 0
jsb: ERROR: File d:\TMP\runtimeTest\frameworks\runtime-src\proj.android\../../js-bindings/bindings/auto/jsb_cocos2dx_auto.cpp: Line: 15095, Function: js_cocos2dx_Director_replaceScene
Invalid Native Object
JS: /data/data/org.cocos2dx.runtimetest/files/debugruntime/script/jsb_cocos2d.js:1789:Error: Invalid Native Object
(evaluatedOK == JS_FALSE)
  • Failure case B: It works now

We will be working with 3.6.1 until the issue is solved.

Could you help us with this issue, @pandamicro?

Oooouh… thank’s god for this post.
I had similar problem and was founding solution for more than 20hrs…

@comjin your files solved the problem, thank’s.
In my case it was problem with win32 simulator, JS, cocos2d-x 3.8.1. Every time I ran the project… simulator crashed with poor message: “rhs.IsString()”, Error in remove file on runtime.