如果项目中有多个native模块(xysdk中包含native模块), 可能会出现libc++_shared库冲突导致的crash, 堆栈大致如下:
#00 pc 00000000000d8c48 /data/storage/el1/bundle/libs/arm64/libc++_shared.so(std::__n1::basic_ostream::sentry::sentry(std::__n1::basic_ostream&)+24)(cdf97be9396a35e8f4806f252f90a11320d26ec6)
#01 pc 00000000000069f0 /data/storage/el1/bundle/libs/arm64/libapplication.so(std::__n1::basic_ostream& std::__n1::__put_character_sequence(std::__n1::basic_ostream&, char const*, unsigned long)+48)(5c0227a065a1ed1c0e8a564a6f1eada6ed5b6790)
#02 pc 0000000000006930 /data/storage/el1/bundle/libs/arm64/libapplication.so(std::__n1::basic_ostream& std::__n1::operator<<(std::__n1::basic_ostream&, char const*)+56)(5c0227a065a1ed1c0e8a564a6f1eada6ed5b6790)
#03 pc 00000000000068ac /data/storage/el1/bundle/libs/arm64/libapplication.so(5c0227a065a1ed1c0e8a564a6f1eada6ed5b6790)
#04 pc 000000000003bff8 /system/lib64/platformsdk/libace_napi.z.so(panda::JSValueRef ArkNativeFunctionCallBack(panda::JsiRuntimeCallInfo*)+216)(e14950c654205757a26744aaff615d4e)
#05 pc 0000000000332130 /system/lib64/module/arkcompiler/stub.an(RTStub_PushCallArgsAndDispatchNative+40)
解决方案:
参考官方文档调整libc++_shared.so打包优先级