Open zhlinh opened 5 months ago
这个问题解决了吗,我也遇到了这个冲突问题,引用了Xlog ,又引用了一个其他三方库,就报这个libc++_shared.so冲突
@wenideveloper have you tried adding pickFirst **/libc++_shared.so
in the Gradle packagingOptions?
If your libc++_shared.so is the same NDK version, pickFirst will work.
When import mars-xlog and other library with libc++_shared.so, it encountered with the crash on launch that:
Search the problem, noticed that it's because the mars-xlog use the ndk r20 to build and include the libc++_shared.so with r20 toolchain, which is different with other lib with r25c toolchain.
1. Info
1.1 With the help of parse_elfnote.py mars-xlog: libc++_shared.so
other-lib: libc++_shared.so
1.2 See the __emutls_get_address symbol with readelf mars-xlog: libc++_shared.so
other-lib: libc++_shared.so
So, the problem is the libc++_shared.so on r25c has __emutls_get_address weak symbol, but libc++_shared.so on r20 doesn't.
2. Try To Resolve
Choose libc++_shared.so on r25c will solve this problem, it can be compatitable with the so created by r20 toolchain.
pickFirst **/libc++_shared.so
on gradle packagingOptions. Unfortunately, not workingNot working, becasause it can not be sure choose which so, sometimes choose r25c, it's OK, but sometimes not.
3. Hope
the MARS TEAM
then can offer diffrent version of c++shared to choose
com.tencent.mars:mars-xlog-stdembed:1.2.5