Albert Bori Albert Bori - 3 months ago 46
iOS Question

Runtime error: dyld: Library not loaded: @rpath/AWSCore.framework/AWSCore

I'm using AWS Mobile Analytics for iOS (2.2.3). After running pod update, I'm getting the following error when trying to run

MyApp
on a physical device:


dyld: Library not loaded: @rpath/AWSCore.framework/AWSCore
Referenced from: /private/var/mobile/Containers/Bundle/Application/4582B679-A162-47CE-80ED-58C8B9BB231B/MyApp.app/MyApp
Reason: Incompatible library version: MyApp requires version 2.0.0 or later, but AWSCore provides version 1.0.0


My cocoapods pod file entry for the AWS Mobile Analytics library is:

pod 'AWSMobileAnalytics'


I've tried decrementing the
AWSMobileAnalytics
version (
pod 'AWSMobileAnalytics', '2.2.2'
), but I still get the same error. Does anyone know how to get around this?

Answer

I cleared the DerivedData folder (/Users/me/Library/Developer/Xcode/DerivedData/), then rebuilt the app, and it worked.

Edit

I got this error again when attempting to add a new primary target to my project. I would get the same error as above when defining the Podfile as such:

target 'MainTarget' do
    pod 'MyCocoapod'
    target 'SecondMainTarget' do
        inherit! :search_paths
    end
end

To fix this, I had to define the Podfile like this:

def my_pods
    pod 'MyCocoapod'
end

target 'MainTarget' do
    my_pods
end

target 'SecondMainTarget' do
    my_pods
end
Comments