Xcode 错误提示 swiftCompatibility50 错误的解决办法

2024年10月16日

Xcode编译项目的时候提示报错:

 

Undefined symbols for architecture x86_64:
 "__swift_FORCE_LOAD_$_swiftCompatibility50", referenced from:
     __swift_FORCE_LOAD_$_swiftCompatibility50_$_Lottie in liblottie-ios.a(AnimatedButton.o)
     __swift_FORCE_LOAD_$_swiftCompatibility50_$_Lottie in liblottie-ios.a(AnimatedControl.o)
     __swift_FORCE_LOAD_$_swiftCompatibility50_$_Lottie in liblottie-ios.a(AnimationSubview.o)
     __swift_FORCE_LOAD_$_swiftCompatibility50_$_Lottie in liblottie-ios.a(CompatibleAnimationView.o)
     __swift_FORCE_LOAD_$_swiftCompatibility50_$_Lottie in liblottie-ios.a(CompositionLayer.o)
     __swift_FORCE_LOAD_$_swiftCompatibility50_$_Lottie in liblottie-ios.a(NullCompositionLayer.o)
     __swift_FORCE_LOAD_$_swiftCompatibility50_$_Lottie in liblottie-ios.a(ImageCompositionLayer.o)
     ...
    (maybe you meant: __swift_FORCE_LOAD_$_swiftCompatibility50_$_lottie_react_native
, __swift_FORCE_LOAD_$_swiftCompatibility50_$_Lottie 
)

 

解决办法:

 

默认的IOS工程会创建swift文件,但是之前被无意之间删除掉了,所以解决方法就是恢复 这个xxx.swift文件,默认写一个

import Foundation

即可

 

 

 

© 1987 - 2023 张晓刚 版权所有

浙ICP备16002143号-1