Skip to content

Commit

Permalink
Fix duplicate symbols linker error in xcodeproj (#23284)
Browse files Browse the repository at this point in the history
Summary:
When using building React Native using the `.xcodeproj` (either via linked projects in Xcode, or precompiling React Native, which is what we do), you'll get a duplicate symbol error:

```
duplicate symbol __ZN8facebook5react10IInspectorD0Ev ...
```

And a few more.

This is because the `InspectorInterfaces.cpp` file is included in _both_ the `React` target _and_ the `jsinspector` target, and since the `jsinspector` target gets linked into the `React` target, this means the symbols from `InspectorInterfaces.cpp` end up in `libReact.a` twice.

<img width="187" alt="screen shot 2019-02-04 at 11 43 39 am" src="https://user-images.githubusercontent.com/819705/52189088-93190880-288a-11e9-8411-b44b59e8e461.png">

This PR removes `InspectorInterfaces.cpp` from the `React` target, as I believe was the original intent.

Since this bug is in the `xcodeproj` it only affects builds that use that, so CocoaPods and Buck users are unaffected.

[iOS][Fixed] - Fix potential linker issues when using xcode project
Pull Request resolved: #23284

Differential Revision: D13941777

Pulled By: cpojer

fbshipit-source-id: 8a3ffb4fc916ff6570bbff8794b4515b48055667
  • Loading branch information
tyrone-sudeium authored and facebook-github-bot committed Feb 4, 2019
1 parent 7ee13cc commit 9f72e6a
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions React/React.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1101,13 +1101,11 @@
E223624420875A8000108244 /* JSExecutor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E223624320875A8000108244 /* JSExecutor.cpp */; };
E9B20B7B1B500126007A2DA7 /* RCTAccessibilityManager.m in Sources */ = {isa = PBXBuildFile; fileRef = E9B20B7A1B500126007A2DA7 /* RCTAccessibilityManager.m */; };
EBF21BBC1FC498270052F4D5 /* InspectorInterfaces.h in Headers */ = {isa = PBXBuildFile; fileRef = EBF21BBA1FC498270052F4D5 /* InspectorInterfaces.h */; };
EBF21BBD1FC498270052F4D5 /* InspectorInterfaces.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EBF21BBB1FC498270052F4D5 /* InspectorInterfaces.cpp */; };
EBF21BBE1FC498630052F4D5 /* InspectorInterfaces.h in Headers */ = {isa = PBXBuildFile; fileRef = EBF21BBA1FC498270052F4D5 /* InspectorInterfaces.h */; };
EBF21BFB1FC498FC0052F4D5 /* InspectorInterfaces.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = EBF21BBA1FC498270052F4D5 /* InspectorInterfaces.h */; };
EBF21BFC1FC4990B0052F4D5 /* InspectorInterfaces.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EBF21BBB1FC498270052F4D5 /* InspectorInterfaces.cpp */; };
EBF21BFE1FC499840052F4D5 /* InspectorInterfaces.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = EBF21BBA1FC498270052F4D5 /* InspectorInterfaces.h */; };
EBF21BFF1FC4998E0052F4D5 /* InspectorInterfaces.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EBF21BBB1FC498270052F4D5 /* InspectorInterfaces.cpp */; };
EBF21C001FC499A80052F4D5 /* InspectorInterfaces.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EBF21BBB1FC498270052F4D5 /* InspectorInterfaces.cpp */; };
ED296F82214C973700B7C4FE /* libjsinspector-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EBF21BFA1FC4989A0052F4D5 /* libjsinspector-tvOS.a */; };
ED296F83214C974A00B7C4FE /* libyoga.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D3C06751DE3340C00C268FA /* libyoga.a */; };
ED296FB7214C9A9A00B7C4FE /* JSIDynamic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EDEBC6DA214B3F6800DD5AC8 /* JSIDynamic.cpp */; };
Expand Down Expand Up @@ -4231,7 +4229,6 @@
13134C871E296B2A00B9F3CB /* RCTCxxBridge.mm in Sources */,
CF2731C31E7B8DF30044CA4F /* RCTDeviceInfo.m in Sources */,
599FAA3F1FB274980058CCF6 /* RCTSurfaceRootShadowView.m in Sources */,
EBF21C001FC499A80052F4D5 /* InspectorInterfaces.cpp in Sources */,
597633371F4E021D005BE8A4 /* RCTShadowView+Internal.m in Sources */,
2D3B5EB11D9B090100451313 /* RCTAppState.m in Sources */,
59E604A31FE9CCE300BD90C5 /* RCTScrollContentViewManager.m in Sources */,
Expand Down Expand Up @@ -4511,7 +4508,6 @@
59D031F71F8353D3008361F0 /* RCTSafeAreaViewLocalData.m in Sources */,
13E067571A70F44B002CDEE1 /* RCTView.m in Sources */,
3D7749441DC1065C007EC8D8 /* RCTPlatform.m in Sources */,
EBF21BBD1FC498270052F4D5 /* InspectorInterfaces.cpp in Sources */,
59EDBCAF1FDF4E0C003573DE /* RCTScrollContentView.m in Sources */,
13D9FEEE1CDCD93000158BD7 /* RCTKeyboardObserver.m in Sources */,
B233E6EA1D2D845D00BC68BA /* RCTI18nManager.m in Sources */,
Expand Down

0 comments on commit 9f72e6a

Please sign in to comment.