FidMe / react-native-fast-storage

A simple, performance oriented key value storage for React Native. Drop in replacement for AsyncStorage
88 stars 13 forks source link

File was built for x86_64 which is not the architecture being linked (arm64) #3

Open jordanmkoncz opened 5 years ago

jordanmkoncz commented 5 years ago

After successfully linking everything correctly as per the instructions in https://github.com/FidMe/react-native-fast-storage/issues/2 and the new readme, I'm able to create Debug builds of the app which work fine in the Simulator. However, when I try to create an Archive ("Product" -> "Archive" in Xcode), I'm getting the following build error:

ld: warning: ignoring file ../node_modules/react-native-fast-storage/ios/MMKV.framework/MMKV, file was built for x86_64 which is not the architecture being linked (arm64): ../node_modules/react-native-fast-storage/ios/MMKV.framework/MMKV
Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_MMKV", referenced from:
      objc-class-ref in libRNFastStorage.a(RNFastStorage.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

After a little bit of research it seems like maybe the version of MMKV.framework that is included in react-native-fast-storage has not been built correctly and as a result it can be used in the Simulator but not when creating an Archive. Hopefully that's fairly easy to resolve and a new version of the package can be released with an updated MMKV.framework file included which is able to be used when creating an Archive.

As a temporary workaround I've undone all of the additional steps to complete the linking of MMKV.framework with the app, and instead installed it via CocoaPods by following the instructions at https://github.com/Tencent/MMKV#installation-via-cocoapods.

Michaelvilleneuve commented 5 years ago

Thank you for reporting this. We are also having the same issue in our pipeline when building for devices. We will offer a fix soon