8. My app won't build on iOS after installing lottie-react-native
The most common building issue for lottie-react-native
in iOS has to do with the lack of support for React Native projects with Swift libraries. In this case, you need to create a Swift bridging header in order to get your app ready for Swift libraries:
- Add a new file through the Xcode menu: File | New | File:
Figure 11.1 – Create a new file in your Xcode project
- Select Swift File:
Figure 11.2 – Select Swift as the file type
- Click on Create Bridging Header:
Figure 11.3 – Confirm the creation of the bridging header
You may need to rebuild your project for the changes to take effect. Once this is done, lottie-react-native
should be ready to display your animation on iOS.