Lottie-ios: "lottie-ios.modulemap not found" regression with CocoaPods 1.7.0 beta

Created on 11 Apr 2019  路  4Comments  路  Source: airbnb/lottie-ios

Check these before submitting:

  • [x] The issue doesn't involve an Unsupported Feature
  • [x] This issue isn't related to another open issue

This issue is a:

  • [] Non-Crashing Bug (Visual or otherwise)
  • [] Crashing Bug
  • [] Feature Request
  • [x] Regression (Something that once worked, but doesn't work anymore)

Which Version of Lottie are you using?

Lottie 3.0

What Platform are you on?

  • [] MacOS
  • [x] iOS

What Language are you in?

  • [x] Swift
  • [] Objective-C

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 library
  • Use CocoaPods 1.6.1 or lower
  • Use an alternate integration method like Carthage

All 4 comments

The 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:

Works

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

Doesn't work

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ricardohochman picture ricardohochman  路  4Comments

loganblevins picture loganblevins  路  3Comments

JALsnipe picture JALsnipe  路  4Comments

rdd7 picture rdd7  路  4Comments

petoye picture petoye  路  3Comments