Lottie 3.0
Although this is not necessarily a bug in Lottie itself, I wanted to preemptively warn the team that there is a regression in CocoaPods 1.7.0 beta that prevents the usage of Lottie with static linking. The upstream issue in CocoaPods is here: https://github.com/CocoaPods/CocoaPods/issues/8695
An example project exhibiting this issue is available here in the 1.7.0 folder: https://github.com/chrisballinger/cocoapods-issue-8695
You will see the following issue when compiling:
<unknown>:0: error: module map file '/Pods/Headers/Public/Lottie/lottie-ios.modulemap' not found
<unknown>:0: error: underlying Objective-C module 'Lottie' not found
My initial assumption that the lottie-ios.podspec module name override was associated with the problem, but the issue persists even without the module name override. Will update this issue when I uncover more information.
Possible workarounds include:
use_frameworks! - this only seems to affect integration as a static libraryThe issue seems to be the dash in the pod name. Changing the podspec name to Lottie from lottie-ios to the following resolves the issue:
Pod::Spec.new do |s|
s.name = 'Lottie'
s.version = '3.0.4'
s.summary = 'A library to render native animations from bodymovin json. Now in Swift!'
s.description = <<-DESC
Lottie is a mobile library for Android and iOS that parses Adobe After Effects animations exported as json with bodymovin and renders the vector animations natively on mobile and through React Native!
For the first time, designers can create and ship beautiful animations without an engineer painstakingly recreating it be hand. Since the animation is backed by JSON they are extremely small in size but can be large in complexity! Animations can be played, resized, looped, sped up, slowed down, and even interactively scrubbed.
DESC
s.homepage = 'https://github.com/airbnb/lottie-ios'
s.license = { :type => 'Apache', :file => 'LICENSE' }
s.author = { 'Brandon Withrow' => '[email protected]' }
s.source = { :git => 'https://github.com/airbnb/lottie-ios.git', :tag => s.version.to_s }
s.swift_version = '4.2'
s.ios.deployment_target = '9.0'
s.osx.deployment_target = '10.10'
s.tvos.deployment_target = '9.0'
s.source_files = 'lottie-swift/src/**/*'
s.ios.source_files = 'lottie-swift/iOS/*.swift'
s.ios.exclude_files = 'lottie-swift/src/Public/MacOS/**/*'
s.tvos.exclude_files = 'lottie-swift/src/Public/MacOS/**/*'
s.osx.exclude_files = 'lottie-swift/src/Public/iOS/**/*'
s.ios.frameworks = ['UIKit', 'CoreGraphics', 'QuartzCore']
s.tvos.frameworks = ['UIKit', 'CoreGraphics', 'QuartzCore']
s.osx.frameworks = ['AppKit', 'CoreGraphics', 'QuartzCore']
s.header_dir = 'Lottie'
end
Pod::Spec.new do |s|
s.name = 'lottie-ios'
s.version = '3.0.4'
s.summary = 'A library to render native animations from bodymovin json. Now in Swift!'
s.description = <<-DESC
Lottie is a mobile library for Android and iOS that parses Adobe After Effects animations exported as json with bodymovin and renders the vector animations natively on mobile and through React Native!
For the first time, designers can create and ship beautiful animations without an engineer painstakingly recreating it be hand. Since the animation is backed by JSON they are extremely small in size but can be large in complexity! Animations can be played, resized, looped, sped up, slowed down, and even interactively scrubbed.
DESC
s.homepage = 'https://github.com/airbnb/lottie-ios'
s.license = { :type => 'Apache', :file => 'LICENSE' }
s.author = { 'Brandon Withrow' => '[email protected]' }
s.source = { :git => 'https://github.com/airbnb/lottie-ios.git', :tag => s.version.to_s }
s.swift_version = '4.2'
s.ios.deployment_target = '9.0'
s.osx.deployment_target = '10.10'
s.tvos.deployment_target = '9.0'
s.source_files = 'lottie-swift/src/**/*'
s.ios.source_files = 'lottie-swift/iOS/*.swift'
s.ios.exclude_files = 'lottie-swift/src/Public/MacOS/**/*'
s.tvos.exclude_files = 'lottie-swift/src/Public/MacOS/**/*'
s.osx.exclude_files = 'lottie-swift/src/Public/iOS/**/*'
s.ios.frameworks = ['UIKit', 'CoreGraphics', 'QuartzCore']
s.tvos.frameworks = ['UIKit', 'CoreGraphics', 'QuartzCore']
s.osx.frameworks = ['AppKit', 'CoreGraphics', 'QuartzCore']
s.module_name = 'Lottie'
s.header_dir = 'Lottie'
end
It's unlikely that we'll rename the pod, so let's follow the report at https://github.com/CocoaPods/CocoaPods/issues/8695
There is apparently a pending PR at https://github.com/CocoaPods/CocoaPods/pull/8706.
Aye! This issue should be closed once 1.7.0beta4 is released
Resolved as of CocoaPods 1.7.0.rc.1