viromedia / viro

ViroReact: AR and VR using React Native
MIT License
2.31k stars 483 forks source link

Building with bitcode enabled #457

Open kimhafr opened 6 years ago

kimhafr commented 6 years ago

Environment

Please provide the following information about your environment:

  1. Development OS: Mac
  2. Device OS & Version: iOS 12.0
  3. Version: ViroReact version 2.11 and React Native version 0.57.2
  4. Device(s): iOS

Description

When building a release-version of our app with bitcode enabled I get this error: ❌ ld: ~/node_modules/react-viro/ios/dist/lib/libViroReact.a(VRTPortalScene.o) does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. file ~/node_modules/react-viro/ios/dist/lib/libViroReact.a for architecture arm64

The wierd thing is that this command: lipo -info ../../node_modules/react-viro/ios/dist/lib/libViroReact.a returns Architectures in the fat file: ../../node_modules/react-viro/ios/dist/lib/libViroReact.a are: armv7 x86_64 arm64

Is this is known issue? It works when bitcode is disabled, but we don't want that.

tetreault commented 6 years ago

Just ran into this after a hell of a time resolving the errors caused by RN/xcode 10 not properly installing third party contents from react-native/third-party, and then it turns out glog creates a broken config if you just run ./configure in the glog folder so you need to run the script in react-native/script, and THEN a reference to libfishook.a wasn't properly linked in RCTWebsocket so you need to delete it and re-add and NOW finally the last error I get is the linker error, requiring bitcode to be disabled.

React native is quite a headache sometimes... 😆

VikAdvani commented 6 years ago

Hi @KimAM, this is a known issue as compiling with bitcode is not supported at this time. Is there a reason you need bitcode supported? The issue might be occurring due to one of our dependencies.

manbod commented 6 years ago

Hi @KimAM , As @VikAdvani pointed out earlier - ViroReact is built with enable_bitcode set to NO since one of our dependencies -> GVR IOS SDK is built without bitcode. That's why we have to build without bitcode.

tetreault commented 6 years ago

There are plans to make viro more modular right? In the sense that I need none of the VR components if I'm making purely an AR app. I believe I saw a comment about this on a closed github issue, and am just wondering out of curiosity.

dam00n commented 6 years ago

This is on our roadmap/backlog but has not been a priority. It is something we will take a look at as we add more device support but there are no near term plans for greater modularity.

kimhafr commented 6 years ago

It's mostly because enabling bitcode would shrink our app size significantly. So not a huge problem, but a highly desired feature.

alexzaganelli commented 3 years ago

Hi guys

there're any update on this?

ramicaza commented 2 years ago

Hasn't GVR been removed from Viro? If so, it should be easy for a maintainer recompile the library with bitcode enabled correct?