react-native-mmkv icon indicating copy to clipboard operation
react-native-mmkv copied to clipboard

duplicate symbols when used with react-native-quick-crypto

Open castdrian opened this issue 2 months ago • 1 comments

when used in a project that also uses react-native-quick-crypto this lib causes the compiler to throw duplicate symbol errors, whilst this still compiles successfully, it probably would be best to avoid this behaviour

⚠️  ld: ignoring duplicate libraries: '-lc++'
❌  duplicate symbol '__Z12isTypedArrayRN8facebook3jsi7RuntimeERKNS0_6ObjectE' in
┌─ libreact-native-mmkv.a[6](TypedArray.o)
└─ libreact-native-quick-crypto.a[22](MGLTypedArray.o)

❌  duplicate symbol '__Z13getTypedArrayRN8facebook3jsi7RuntimeERKNS0_6ObjectE' in
┌─ libreact-native-mmkv.a[6](TypedArray.o)
└─ libreact-native-quick-crypto.a[22](MGLTypedArray.o)

❌  duplicate symbol '_propNameIDCache' in
┌─ libreact-native-mmkv.a[6](TypedArray.o)
└─ libreact-native-quick-crypto.a[22](MGLTypedArray.o)

❌  duplicate symbol '__ZN15PropNameIDCache10createPropERN8facebook3jsi7RuntimeE4Prop' in
┌─ libreact-native-mmkv.a[6](TypedArray.o)
└─ libreact-native-quick-crypto.a[22](MGLTypedArray.o)

❌  duplicate symbol '_nameToKindMap' in
┌─ libreact-native-mmkv.a[6](TypedArray.o)
└─ libreact-native-quick-crypto.a[22](MGLTypedArray.o)

❌  duplicate symbol '__Z17arrayBufferUpdateRN8facebook3jsi7RuntimeERNS0_11ArrayBufferENSt3__16vectorIhNS5_9allocatorIhEEEEm' in
┌─ libreact-native-mmkv.a[6](TypedArray.o)
└─ libreact-native-quick-crypto.a[22](MGLTypedArray.o)

❌  duplicate symbol '__Z24getTypedArrayKindForNameRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE' in
┌─ libreact-native-mmkv.a[6](TypedArray.o)
└─ libreact-native-quick-crypto.a[22](MGLTypedArray.o)

❌  duplicate symbol '__Z19arrayBufferToVectorRN8facebook3jsi7RuntimeERNS0_6ObjectE' in
┌─ libreact-native-mmkv.a[6](TypedArray.o)
└─ libreact-native-quick-crypto.a[22](MGLTypedArray.o)

castdrian avatar Apr 15 '24 01:04 castdrian

thanks for the report. Yea, in V3 (https://github.com/mrousavy/react-native-mmkv/pull/656) I removed TypedArray in favor of simplifying it to jsi::ArrayBuffer. That gives you more granular control over what bytes you want to store (Uint8Array, Float32Array or any other typed arrays!), and it fixes your build error/warnings.

mrousavy avatar Apr 15 '24 07:04 mrousavy