react-native-lottie-splash-screen: iOS Swift file not found

Run react-native info in your project and share the content. info Fetching system and libraries information... (node:22236) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency (Use node --trace-warnings … to show where the warning was created) System: OS: macOS 11.1 CPU: (16) x64 Intel(R) Core(TM) i7-10700K CPU @ 3.80GHz Memory: 26.45 MB / 8.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 14.15.5 - /usr/local/bin/node Yarn: 1.22.10 - /usr/local/bin/yarn npm: 7.5.4 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman Managers: CocoaPods: 1.10.1 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: iOS 14.3, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2 Android SDK: Not Found IDEs: Android Studio: 4.1 AI-201.8743.12.41.6953283 Xcode: 12.3/12C33 - /usr/bin/xcodebuild Languages: Java: 15.0.1 - /usr/bin/javac Python: 2.7.16 - /usr/bin/python npmPackages: @react-native-community/cli: Not Found react: 16.13.1 => 16.13.1 react-native: 0.63.4 => 0.63.4 react-native-macos: Not Found npmGlobalPackages: *react-native*: Not Found What react-native-splash-screen version are you using? "react-native-splash-screen": "^3.2.0", What platform does your issue occur on? (Android/iOS/Both) Both Describe your issue as precisely as possible :

  1. I folled the dosc for iOS but its says #import “AwesomeProject-Swift.h” not found is XCode

Join a screenshot or video of the problem on the simulator or device? Screenshot 2021-03-13 at 11 51 02 AM Screenshot 2021-03-13 at 11 51 47 AM Screenshot 2021-03-13 at 11 56 23 AM Screenshot 2021-03-13 at 11 57 19 AM

Show us the code you are using?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 2
  • Comments: 22 (13 by maintainers)

Most upvoted comments

@mayfairr try doing yarn add lottie-react-native after i added this package the error gone and do clean iOS project.

Yes the problem with the [projectName]-Swift.h was that the project name was not named correctly. To fix this I simply went to:

[projectName] > Build Settings > All > Swift Compiler General > Objective-C Generated Interface Header Name

Hi @KawaljeetCuelogic when you create the .swift file xcode well ask you to create Bridging-Header.h say YES there. and for “No such module ‘Lottie’” error I did yarn add lottie-react-native and cd ios && pod install and after that build successfully 🎉🥂 .

my project link note :.json is missing in the repo for iOS

At first, I have searched many articles about changing ios’s LaunchScreen.storyboard with lottie animation. However, Xcode enforces that LaunchScreen.storyboard should be static screen. So, I inserted animation code after static launch screen loading. Maybe, launch screen is essential, because it is loading screen for initial loading resource in ios. If you remove the launch screen, then ios app shows black or white screen at first loading. https://stackoverflow.com/questions/37975826/remove-launch-screen-xcode-7

Hi @KawaljeetCuelogic and @HwangTaehyun iOS build is successfully now the splash screen shows up nicely but i want to know how can i remove the default splash view LaunchScreen.storyboard

  1. default splash view LaunchScreen.storyboard
  1. The react-native-lottie-splash-screen

Incase any one having issues with build this is how your project should look like

Screenshot 2021-03-20 at 1 24 55 PM

I think I had a similar problem in the past. Have you tried the solutions of the stack overflow articles below?

https://stackoverflow.com/questions/26328034/importing-project-swift-h-into-a-objective-c-class-file-not-found https://stackoverflow.com/questions/47679450/project-swift-h-file-not-found/47679927

First of all, it would be nice to try the following things first.

  1. Clear derived data.
  2. If the compilation is not done properly, the file(<Project>-swift.h) may not be created automatically.

Thank you!