4

I'm trying to integrate Localytics into my iOS app and am using cocoapods:

pod 'Localytics'

However, when I start my app (I'm not even invoking or importing the Localytics namespace yet) my app blows up with this error:

dyld: Library not loaded: @rpath/Localytics.framework/Localytics
  Referenced from: /Users/bobbydavro/Library/Developer/CoreSimulator/Devices/8A21B45E-D77B-41F7-AB45-8F77DE48A4AF/data/Containers/Bundle/Application/556E667A-59D9-4072-81F1-B9CA600E0C46/MyApp.app/MyApp
  Reason: image not found

I've found a number of related SO articles on this but none of the suggested fixes work:

  • make the linked pods binary 'optional'
  • disable bitcode
  • pod deintegrate, then re-install

I'm stuck, I also tried using Segment to integrate but it has a direct dependency on the same pod and blows up exactly the same way :/

ConfusedNoob
  • 9,826
  • 14
  • 64
  • 85

3 Answers3

3

Well, try the following: go to Project Setting Your_Target -> General -> Embedded Binaries -> click on + button and add your library here

Evgeny Karkan
  • 8,782
  • 2
  • 32
  • 38
2

To use the dynamic framework with Cocoapods 1.0, you need to add the use_frameworks! statement to your Podfile.

platform :ios, '8.0'

target 'MyApp' do
    use_frameworks!

    pod 'Localytics'
end
deRonbrown
  • 635
  • 7
  • 14
  • @Jay-Whitsitt, can you test to see if this solution will work instead of using the static framework? – deRonbrown Oct 27 '16 at 20:40
  • Added use_frameworks and worked for me. Side effect was that I needed to change some header imports from <> to "" for some libs I am using. – mraty Dec 28 '16 at 11:38
1

This was happening to me as well. For some reason, my project didn't like their dynamic framework. (I'm not supporting iOS 7 so that shouldn't be an issue.)

My fix was to use their static framework.

pod 'LocalyticsStaticFramework'

It's likely an issue with the project settings, not their framework.

Jay Whitsitt
  • 937
  • 9
  • 27