Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module compiled with Swift 5.2.4 cannot be imported by the Swift 5.3 compiler #683

Closed
bouchja1 opened this issue Sep 18, 2020 · 7 comments
Closed

Comments

@bouchja1
Copy link

Description

I have upgraded XCode version to 12.0 and suddenly it is not possible to build the project because there is an error shown:

AnimationViewManagerModule.swift:5:8: error: module compiled with Swift 5.2.4 cannot be imported by the Swift 5.3 compiler

Steps to Reproduce

  1. update your XCode version to 12.0
  2. using lottie-react-native v3.5.0
  3. react-native run-ios

Expected behavior: [What you expected to happen]

  • the project is built correctly and my app is runnin

Actual behavior: [What actually happened]

/Users/janbouchner/cfhero/cfhero-react/node_modules/lottie-react-native/src/ios/LottieReactNative/AnimationViewManagerModule.swift:5:8: error: module compiled with Swift 5.2.4 cannot be imported by the Swift 5.3 compiler: /Users/janbouchner/cfhero/cfhero-react/ios/build/CFHero/Build/Products/Debug-iphonesimulator/lottie-ios/Lottie.swiftmodule/x86_64-apple-ios-simulator.swiftmodule
import Lottie
^

** BUILD FAILED **

The following build commands failed:
CompileSwift normal x86_64 /Users/janbouchner/cfhero/cfhero-react/node_modules/lottie-react-native/src/ios/LottieReactNative/AnimationViewManagerModule.swift
CompileSwift normal x86_64 /Users/janbouchner/cfhero/cfhero-react/node_modules/lottie-react-native/src/ios/LottieReactNative/ContainerView.swift
CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
(3 failures)

Versions

  • lottie-ios v3.1.8
  • lottie-react-native v 3.5.0
@magrinj
Copy link

magrinj commented Sep 18, 2020

Facing same issue, I've tried to put Build Libraries for Distribution = YES on LottieReactNative.xcodeproj but still the same error, anyone else got this error ?

@magrinj
Copy link

magrinj commented Sep 18, 2020

@bouchja1 Ok, I think I've found a way to build, I've done the following steps and it's working:

  • Remove Podfile.lock in ios directory
  • Remove Pods directory in ios directory
  • Run pod update in ios directory
  • Got to Xcode -> Preferences -> Locations
  • Check that the command line tools used is Xcode 12.0.0
  • Under Derived Data: you have a path with a small arrow, click on the arrow and delete DerivedData from directory
  • Run Product -> Clean
  • Try yo build your project again

Hope that's going to help !

@bouchja1
Copy link
Author

@bouchja1 Ok, I think I've found a way to build, I've done the following steps and it's working:

  • Remove Podfile.lock in ios directory
  • Remove Pods directory in ios directory
  • Run pod update in ios directory
  • Got to Xcode -> Preferences -> Locations
  • Check that the command line tools used is Xcode 12.0.0
  • Under Derived Data: you have a path with a small arrow, click on the arrow and delete DerivedData from directory
  • Run Product -> Clean
  • Try yo build your project again

Hope that's going to help !

Thanks! This worked also for me. You probably know this but there is an alias to clear "Pods" directory. Instead of deleting the whole folder you can use the command:

pod deintegrate

And I am stopping to be a "smart" guy :D

@magrinj
Copy link

magrinj commented Sep 19, 2020

@bouchja1 Haha no problem, I know that command but I'm not using it quite often it's why I'm doing it in the old basic way ^^

@schumannd
Copy link

In case you build the app using the xcodebuild command and have a paramter -derivedDataPath, make sure to clear the files there.

@yabao-zy
Copy link

@bouchja1 thanks very much , beacusn help me

@dodody
Copy link

dodody commented Jan 6, 2022

@magrinj thank you ㅠㅜㅠㅜ love you🥺

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants