[0]关于laya native封装成flutter插件的问题

我们希望把laya native封装成flutter插件用于在App中集成游戏。
flutter提供的方式是把Android/iOS原生的view包装为PlatformView。
laya native默认的退出界面回收资源的方式是杀进程,但是这显然会导致我们整个App被杀掉。
请问怎样可以在退出游戏页面的时候不杀进程,然后确保该游戏页面还能反复进入。
已邀请:

李青峰

赞同来自:

如果把System.exit(0)注释掉,第二次初始化页面的时候会crash,错误日志如下:
 
2021-12-13 16:04:10.962 30424-30843/com.layabox.conch6 A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x10 in tid 30843 (GLThread 119744), pid 30424 (.layabox.conch6)
2021-12-13 16:04:11.030 30848-30848/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2021-12-13 16:04:11.030 30848-30848/? A/DEBUG: Build fingerprint: 'HUAWEI/ALP-AL00/HWALP:10/HUAWEIALP-AL00/10.0.0.175C00:user/release-keys'
2021-12-13 16:04:11.030 30848-30848/? A/DEBUG: Revision: '0'
2021-12-13 16:04:11.030 30848-30848/? A/DEBUG: ABI: 'arm64'
2021-12-13 16:04:11.032 30848-30848/? A/DEBUG: SYSVMTYPE: Maple
    APPVMTYPE: Art
2021-12-13 16:04:11.033 30848-30848/? A/DEBUG: Timestamp: 2021-12-13 16:04:11+0800
2021-12-13 16:04:11.033 30848-30848/? A/DEBUG: pid: 30424, tid: 30843, name: GLThread 119744  >>> com.layabox.conch6 <<<
2021-12-13 16:04:11.033 30848-30848/? A/DEBUG: uid: 10343
2021-12-13 16:04:11.033 30848-30848/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x10
2021-12-13 16:04:11.033 30848-30848/? A/DEBUG: Cause: null pointer dereference
2021-12-13 16:04:11.033 30848-30848/? A/DEBUG:     x0  00000072afc85b80  x1  0000000000000001  x2  0000007326850888  x3  0000000000000003
2021-12-13 16:04:11.033 30848-30848/? A/DEBUG:     x4  0000000000000000  x5  00000072dba84a48  x6  0000000000000000  x7  0000000000000000
2021-12-13 16:04:11.033 30848-30848/? A/DEBUG:     x8  0000000000000000  x9  a90207e54fd599ca  x10 00000000ffffffff  x11 0000000000000000
2021-12-13 16:04:11.033 30848-30848/? A/DEBUG:     x12 0000000000022674  x13 0000000000001980  x14 0000000000000030  x15 aaaaaaaaaaaaaaab
2021-12-13 16:04:11.033 30848-30848/? A/DEBUG:     x16 00000072c7a36ba0  x17 00000072c6cf36b4  x18 000000727793c000  x19 00000072dc673090
2021-12-13 16:04:11.033 30848-30848/? A/DEBUG:     x20 00000072afc85b80  x21 00000072dba85020  x22 00000072dba85020  x23 00000072dba84dd8
2021-12-13 16:04:11.033 30848-30848/? A/DEBUG:     x24 00000072dba84d50  x25 00000072dba84d50  x26 00000072dba85020  x27 0000007331bf2020
2021-12-13 16:04:11.033 30848-30848/? A/DEBUG:     x28 0000007331bf0810  x29 00000072dba84a80
2021-12-13 16:04:11.033 30848-30848/? A/DEBUG:     sp  00000072dba84a40  lr  00000072c6b36188  pc  00000072c6b36190
2021-12-13 16:04:11.039 30848-30848/? A/DEBUG: backtrace:
2021-12-13 16:04:11.039 30848-30848/? A/DEBUG:       #00 pc 00000000009b1190  /data/app/com.layabox.conch6-bx85w5ky1VUVee42cNjs9A==/lib/arm64/liblayaair.so (v8::internal::IsolateAllocator::InitReservation()+48) (BuildId: c4bba7cfdf3587fbe2323245b952810e8f521d25)
2021-12-13 16:04:11.039 30848-30848/? A/DEBUG:       #01 pc 00000000009b1110  /data/app/com.layabox.conch6-bx85w5ky1VUVee42cNjs9A==/lib/arm64/liblayaair.so (v8::internal::IsolateAllocator::IsolateAllocator(v8::internal::IsolateAllocationMode)+40) (BuildId: c4bba7cfdf3587fbe2323245b952810e8f521d25)
2021-12-13 16:04:11.039 30848-30848/? A/DEBUG:       #02 pc 00000000008c6e3c  /data/app/com.layabox.conch6-bx85w5ky1VUVee42cNjs9A==/lib/arm64/liblayaair.so (v8::internal::Isolate::New(v8::internal::IsolateAllocationMode)+36) (BuildId: c4bba7cfdf3587fbe2323245b952810e8f521d25)
2021-12-13 16:04:11.039 30848-30848/? A/DEBUG:       #03 pc 0000000000843198  /data/app/com.layabox.conch6-bx85w5ky1VUVee42cNjs9A==/lib/arm64/liblayaair.so (v8::Isolate::New(v8::Isolate::CreateParams const&)+20) (BuildId: c4bba7cfdf3587fbe2323245b952810e8f521d25)
2021-12-13 16:04:11.039 30848-30848/? A/DEBUG:       #04 pc 00000000006bdfe8  /data/app/com.layabox.conch6-bx85w5ky1VUVee42cNjs9A==/lib/arm64/liblayaair.so (laya::Javascript::initJSEngine()+76) (BuildId: c4bba7cfdf3587fbe2323245b952810e8f521d25)
2021-12-13 16:04:11.039 30848-30848/? A/DEBUG:       #05 pc 00000000006be9e0  /data/app/com.layabox.conch6-bx85w5ky1VUVee42cNjs9A==/lib/arm64/liblayaair.so (laya::JSV8Worker::_runLoop()+40) (BuildId: c4bba7cfdf3587fbe2323245b952810e8f521d25)
2021-12-13 16:04:11.039 30848-30848/? A/DEBUG:       #06 pc 000000000078a030  /data/app/com.layabox.conch6-bx85w5ky1VUVee42cNjs9A==/lib/arm64/liblayaair.so (laya::JCDataThread<std::__ndk1::function<void ()>>::__ThreadEntry()+104) (BuildId: c4bba7cfdf3587fbe2323245b952810e8f521d25)
2021-12-13 16:04:11.039 30848-30848/? A/DEBUG:       #07 pc 000000000078a1b0  /data/app/com.layabox.conch6-bx85w5ky1VUVee42cNjs9A==/lib/arm64/liblayaair.so (_ZNSt6__ndk114__thread_proxyINS_5tupleIJNS_10unique_ptrINS_15__thread_structENS_14default_deleteIS3_EEEENS_6__bindIMN4laya12JCDataThreadINS_8functionIFvvEEEEEFvvEJPSD_EEEEEEEEPvSJ_+64) (BuildId: c4bba7cfdf3587fbe2323245b952810e8f521d25)
2021-12-13 16:04:11.039 30848-30848/? A/DEBUG:       #08 pc 00000000000cf7c0  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36) (BuildId: b91c775ccc9b0556e91bc575a2511cd0)
2021-12-13 16:04:11.039 30848-30848/? A/DEBUG:       #09 pc 00000000000721a8  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: b91c775ccc9b0556e91bc575a2511cd0)
2021-12-13 16:04:11.471 1040-1391/? E/Parcel: Reading a NULL string not supported here

要回复问题请先

商务合作
商务合作