lottie-react-native: iOS doesn't build latest version 3.0.3
Description
I’m receiving an error while trying to build my project, something related to Lottie.modulemap.
Error:
fatal error: module map file '/Users/user/Library/Developer/Xcode/DerivedData/app-dzebxnujdxzfoldhzwemhljtfkye/Build/Products/Debug-iphonesimulator/lottie-ios/Lottie.modulemap' not found
Steps to Reproduce
- Install the latest dependency
- run
react-native run-iosor try to build in the Xcode
Expected behavior: The project should build and run the app.
Actual behavior: [What actually happened]
Build process fails by not finding the path lottie-ios/Lottie.modulemap
Versions
react-native: 0.60.3 lottie-ios: 3.0.3 lottie-react-native: 3.0.2
You can get this information from executing npm version.
{ app: '0.0.1',
npm: '6.9.0',
ares: '1.14.0',
cldr: '33.1',
http_parser: '2.8.0',
icu: '62.1',
modules: '64',
napi: '3',
nghttp2: '1.34.0',
node: '10.13.0',
openssl: '1.1.0i',
tz: '2018e',
unicode: '11.0',
uv: '1.23.2',
v8: '6.8.275.32-node.36',
zlib: '1.2.11' }
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 19
- Comments: 55 (3 by maintainers)
I’ve solved this issue. If you’re using
ios/{projectName}.xcodeprojwith XCode to build your project, it’ll cause this error because the latest RN version is using CocoPods to manage dependencies. You should useios/{projectName}.xcworkspaceinstead (reopen XCode - open another project - select the xcworkspace file)This is kind of silly, but if you are upgrading react-native and your dependencies, and you just bumped your
platform :ios, '12.0'to XX.X make sure you have the same number as here:General > Deployment Info > Target iPhone
I was able to build
npx react-native run-iosbut not to Product > Archive, and the error showing was this, Hope this helps someone in a future.Another thing to note from the README:
Apps that use static Xcode project linking need to set iOS deployment version to iOS 12 or switch to CocoaPods-based linking (using frameworks) or downgrade lottie-react-native to version 2.6.1.
I bumped iOS Deployment Target to 11.0 and it fixed it for me
Check the steps and later you can build again running the
npx react-native run-ioscommand https://stackoverflow.com/questions/52536380/why-linker-link-static-libraries-with-errors-iosI also had the same issue. then i tried above mentioned solution, those are not worked for me. this was happened after library updating my React-Native project. Then i fixed my issue. i checked both podfile and Build settings ios deployment target and platform version. when i checked them version number of those two are differe
nt. then keep them in same version number and issue was fixed for me.
For me rebooting finally fixed the problem 😐
None of the solutions above work for me (paths, cocoapods versions, blank swift file). Not sure why this was closed when it’s clearly still a problem…
RN 0.61.0 rc.0 Latest lottie/lottie-ios
----- Update
Manage to track down this SO page.
Deleted the mentioned DerivedData folder, fully closed/reopened Xcode, clean and re-build. Works!
Oddly, if i build with npm or xcode the project builds fine, however, when fastlane builds the project, I’m getting this error.
Just create a Blank Swift file on XCode. And click on the “Create Bridge Header” after this.
Same here, tried all suggestions but build wont go, error is: Module map file… and Failed to emit precompiled header…
Wow this issue is fixed by adding a dummy
swiftfile as you can see here https://github.com/react-native-community/lottie-react-native/commit/08536d5926b9e6510ba5f93bb68070981b1b8bb7#diff-04c6e90faac2675aa89e2176d2eec7d8R35, thanks @emilioicai! 👍MR of my changes, check the native configuration for iOS => https://github.com/jdnichollsc/randomuser-me/commit/afa9ae04170e822e1bb625c287dbf7709fdaa959
Actually I think the issue might be related to a specific CocoaPods version: https://github.com/airbnb/lottie-ios/issues/859
Which version of CocoaPods are you guys using? @iagorm @eduardoborges @jdnichollsc
Go to “File” > “Project Settings” change to “New Build System”
Had the same issue on M1 Mac, @jeiemgi solution is the only one that worked for me.
@jeiemgi getting the ios versions to match fixed it for me. thanks!!!
You save my life bro
I solved the issue by adding Lottie_ios to schemes in xcode project.
@Rutvik17 are you building from your projects workspace?
I’m on RN 0.61.4 and lottie ios 3.1.3 and lottie RN 3.3.2 and it’s building.
Same here, I tried everything listed here.
Tried what you said and now is showing two errors:
UPDATE Even creating a new project and adding lottie-react-native and lottie-ios for RN 60 >=, running
pod install, the error happens too.@emilioicai, I’m using the 1.7.4 (almost sure is that one) version of cocoapod, also I saw and tried the solution you provided and nothing. I’m using RN 60 with auto link.
By running
Pod install, build fails too.Did you run yarn install lottie-ios? What about pod install? @iagorm