Add troubleshooting content about swift errors in React Native build (#794)

Summary:
Going through the `Getting Started` tutorial with `"react-native": "0.61.5"` makes the app crash when you build it, in order to get it working you must add a `.swift` file to the project.

## Changelog

Add troubleshooting content about swift errors in React Native build
Pull Request resolved: https://github.com/facebook/flipper/pull/794

Reviewed By: passy

Differential Revision: D19852986

Pulled By: mweststrate

fbshipit-source-id: 16bc44ad573dc20b90f57777ea1c9cfca7c7c4c9
This commit is contained in:
Lucas Bento
2020-02-17 06:19:45 -08:00
committed by Facebook Github Bot
parent 15cde55981
commit 9c873bd034
3 changed files with 29 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 753 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 705 KiB

View File

@@ -86,3 +86,32 @@ debugImplementation('com.facebook.flipper:flipper:*') {
exclude group: 'com.squareup.okhttp3'
}
```
## iOS
### Build errors in React Native
If you experience errors such as `Undefined symbol: associated type descriptor for FloatLiteralType` or `Undefined symbol: __swift_FORCE_LOAD_$_swiftCompatibility50` after going through the [Getting Started](/docs/getting-started.html) tutorial you must do as follows:
1. Open your project in Xcode;
1. Click in your project's name on the left side;
1. Make sure that you choose your project under `PROJECT` on the screen that has been opened;
1. Go to the tab `Build Settings`;
1. Search for `LD_RUNPATH_SEARCH_PATHS` (make sure that `All` is selected);
1. Double-click `Runpath Search Paths` and, in the dialog that opens, click on the plus button at the bottom-left corner and paste `/usr/lib/swift $(inherited)` there;
![Screenshot showing the places mentioned in the first steps](/docs/assets/troubleshooting-react-native-ios-swift.png)
1. Now search for `LIBRARY_SEARCH_PATHS`;
1. Double-click `Library Search Paths` and, in the dialog that opens, add the following items:
```
"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)"
"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)"
"$(inherited)"
```
_Note: all of them should be added as `non-recursive` (the default)._
In the end it should look like this:
![Screenshot showing the places mentioned in the last steps](/docs/assets/troubleshooting-react-native-ios-swift-2.png)
1. Now you can run your build normally.