Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dyld: Library not loaded: @rpath/Alamofire.framework/Alamofire on my iPhone(iOS8) while debuging #101

Closed
imWildCat opened this issue Sep 15, 2014 · 58 comments

Comments

@imWildCat
Copy link

dyld: Library not loaded: @rpath/Alamofire.framework/Alamofire
  Referenced from: /private/var/mobile/Containers/Bundle/Application/XXX/Anachronos.app/Anachronos
  Reason: image not found

Xcode6 GM

I've read all the issues about this kind of problem, but couldn't solve the problem.

Also, there is the same issue in iOS Example project:

dyld: Library not loaded: @rpath/Alamofire.framework/Alamofire
  Referenced from: /private/var/mobile/Containers/Bundle/Application/CEA6C4C1-C211-460C-8ECF-4FD9C66F1016/iOS Example.app/iOS Example
  Reason: image not found
@mikoj
Copy link

mikoj commented Sep 15, 2014

I had a similar issue
Build Phases
zrzut ekranu 2014-09-15 o 21 08 34
General
zrzut ekranu 2014-09-15 o 21 09 23

@imWildCat
Copy link
Author

@mikoj Thank you very much!

@Paludis
Copy link

Paludis commented Sep 17, 2014

Also have the same issue with the example project, would be nice if the example built out of the box.

@mattt
Copy link
Sponsor Contributor

mattt commented Sep 18, 2014

Fixed by cb7dde5.

@khunshan
Copy link

khunshan commented Dec 1, 2014

Thanks @mikoj

@hernanarber
Copy link

THANKS :-)

@KevinIsSun
Copy link

I have the same question, I just do as Mikoj told, but i still crash on my iPhone, not in simulator.I really do not know how to do

@minhoryang
Copy link

Me too as KevinIsSun said.. Is this really resolved?

@mmmattos
Copy link

Thanks all for the insights in solving this issue.
Just one clarification. The "Embed Frameworks" option was not available on xCode 6.3 under Build Phases. It is actually a "Copy Files Phase" (clicking in the +) in the same Build Phases.
I had to do it too for other framework I use (SwiftyJSON).

@mushu8
Copy link

mushu8 commented Jul 8, 2015

I have the same problem except that my Alamofire is embeded in a framework that is linked to my project…
dyld: Library not loaded: @rpath/Alamofire.framework/Alamofire
Referenced from: /private/var/mobile/Containers/Bundle/Application/4D3EC3B3-70DF-44A1-878D-03D717C65CFD/Fabville Recette.app/Fabville Recette
Reason: image not found

@juanfv2
Copy link

juanfv2 commented Jul 17, 2015

Thank you very much!, This was very useful

@Nadohs
Copy link

Nadohs commented Jul 21, 2015

@mikoj if this were SO, I would upvote you. thanks

@tomaszwojcik
Copy link

Still have the same issue, XCode 6.4, iOS 8.0+, Swift 1.2, using CocoaPods, Alamofire 1.3.

dyld: Library not loaded: @rpath/Alamofire.framework/Alamofire
  Referenced from: /private/var/mobile/Containers/Bundle/Application/76F222DA-1278-463E-976B-AA9C3497625E/XXX.app/XXX
  Reason: no suitable image found.  Did find:
    /private/var/mobile/Containers/Bundle/Application/76F222DA-1278-463E-976B-AA9C3497625E/RemoteMyApp.app/Frameworks/Alamofire.framework/Alamofire: mach-o, but wrong architecture
    /private/var/mobile/Containers/Bundle/Application/76F222DA-1278-463E-976B-AA9C3497625E/RemoteMyApp.app/Frameworks/Alamofire.framework/Alamofire: mach-o, but wrong architecture
    /private/var/mobile/Containers/Bundle/Application/76F222DA-1278-463E-976B-AA9C3497625E/RemoteMyApp.app/Frameworks/Alamofire.framework/Alamofire: mach-o, but wrong architecture

@kevin-hirsch
Copy link

@mikoj It worked. Thank you!

@mikecamara
Copy link

@mikoj It worked. Thank you! 👍

@BellAppLab
Copy link

+1 @mikoj

Closed to prevent too many "thank you" and "you're awesome".

@nelsongc
Copy link

it's working, thanks

@derpoliuk
Copy link

@mushu8 Did you resolve this issue with Alamofire inside framework?

@abury
Copy link

abury commented Dec 28, 2015

@derpoliuk @mushu8 Came across this thread trying to solve a similar problem when adding a 3rd party framework to a framework i'm building.
I resolved it by heading to build phases and adding a 'new copy files phase'. Set destination to 'Frameworks' and then drag the framework into the list

(Example shows SDWebImage framework, but has universally solved the same problem I was having with Realm and MockingJay)
screen shot 2015-12-28 at 5 12 40 pm

Hope it helps

EDIT: Can't recommend this anymore; Although it works well in development Apple actually rejects apps that have a framework with embedded frameworks... Not sure why)

@comlog
Copy link

comlog commented Dec 30, 2015

I have the same problem ,It does not work ,how to dear the problem? for help online

@korovyev
Copy link

korovyev commented Jan 2, 2016

@abury what that method produces in the client of your frameworks project is this:
screen shot 2016-01-02 at 17 58 21

Unfortunately they will be able to see every framework you use in your own framework. I believe the correct way to do this (correct me if I'm wrong) is to get the client to include each framework themselves as all frameworks should be linked and copied app-level. It reduces problems with versioning of frameworks also I believe.

What I would like to do is embed frameworks inside my framework, and not have them accessible by, or even visible to, the user of my framework. Unfortunately I think that is not possible, so I am starting to think I cannot use Alamofire in my framework.

@abury
Copy link

abury commented Jan 3, 2016

@korovyev You're right in that it shows that the frameworks dependancies can be seen from within the framework itself (I didn't know it did that!) But I'm not sure that they can then be used in the host application.
I just tried to import one of those frameworks into the host application and it didn't recognise it. Only when I imported that framework into the host app itself did it work ok, so you shouldn't run into any issues with versioning.
Whether or not the client app should include dependancies themselves I think depends on how your designing the framework itself to be built. I want something that's simple for people to start using straight away without worrying about managing dependancies. While there may be a small duplication of code if the host app also chooses to use the same framework, it's a matter of < 500 kb (as well as being hypothetical)
Alternatively you can just include the raw source files and see if that works 😄

@iparq
Copy link

iparq commented Jan 5, 2016

monosnap 2016-01-05 15-47-14

Great. WHICH ONE?

@madhumitha89
Copy link

madhumitha89 commented Jul 19, 2016

I also have the same issue.I tried every solutions above.But not working.Please help me to solve this.After adding framework in 'Copy Files Phase' and 'Linked libraries',in my project it shows the framework as in red color.So its telling like 'framework not found alamofire'

@iosraven
Copy link

I have tried. And it could build.. u are very helpful. thanks! @mikoj

@binjCN
Copy link

binjCN commented Jul 25, 2016

This issue also showed up for me ,please help me!

@madhumitha89
Copy link

Hi,

Embed Pods framework is the reason for this.UITest -> Buildphases -> Embed
Pods framework is missing.Copy from target and paste it in UITest target.It
worked for me.

On Mon, Jul 25, 2016 at 12:18 PM, binjCN notifications@github.com wrote:

This issue also showed up for me ,please help me!


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#101 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ATle3TB_PvvILNSqbfgPXJIBqo26B3eGks5qZFwsgaJpZM4CiG0e
.

@thanhdevapp
Copy link

thanhdevapp commented Jul 28, 2016

I fixed, solution is
Project -> General Tab -> Linked Framworks and Libraries -> Choose AlamorefireImage.framework

@adammendoza
Copy link

When you have this:
Project -> General Tab -> Linked Framworks and Libraries -> Choose AlamorefireImage.framework
Should the Status be "Required" or "Optional"?

@adammendoza
Copy link

Besides Linked Framework and Embed, I also had to add a Copy Phase

@gurumobile
Copy link

I resolve this issue as like followings.
In General->Embedded Binaries, I added necessary framework.
So app is working as well.
Thanks.

@troyibm
Copy link

troyibm commented Dec 2, 2016

Even after doing what was suggested by Mikoj I was still getting this error. It wasn't until I set 'enable bitcode' to No in build settings that it started to work. :/

@grantkemp
Copy link

Hi guys- I noticed that loads of people are still getting this error.
I have found a fix that has worked for me and is pretty easy.
I think its down to permissions. I have logged the issue with Apple as they really need to fix this bug.

When I changed the permission of the world Wide Developer cert to Use System defaults then it worked. I have included the steps and screenshots in the link below

I would encourage you to log the ticket in apple bug report as mentioned here as Apple really should solve this massive error:
link to SO fix steps

@NrmeenTomoum
Copy link

dyld: Library not loaded: @rpath/Alamofire.framework/Alamofire
Referenced from: /var/containers/Bundle/Application/CC9B5DD0-5243-4044-8798-304DE53EE417/aswaq.app/aswaq
Reason: no suitable image found.

@peixuan197
Copy link

Hi guys,I also get this error,and I still did not resolve after all of the methods used!Then I did not fix the problem after changed the Xcode version, but I did not have a problem on another Mac.So what can I do? it got me crazy!!!

@grantkemp
Copy link

Hi @peixuan197 it still happens periodically with me. I find that when I run my tests a second time - then it works ok.
I suggest raising the issue as but with Xcode - its something that has clearly been introduced in the last two versions of xcode ( 8.21 for me) I never had this before. Compile times also seem to have gone up drastically.

  • Log your bug here: https://bugreport.apple.com
    🔥 If you reference Apple bug: 29915305 - you can help them see how big the issue is.

@like-milk
Copy link

Thank you very much!, This was very useful @mikoj

honghaoz added a commit to Ch0uti/ChouTi that referenced this issue Apr 27, 2017
- In Embed Frameworks, unselect `Copy only when installing` fixes the problem, this also fixes iOS example tests
- Enable tests for example project
- Reference: Alamofire/Alamofire#101 (comment)
@thihaaung6245
Copy link

@OmarAlEisa , Special thanks to you, I did experienced this because I removed all certificates from my keychain!!! Thanks to you.

@daibodhisattva
Copy link

Just had the same issue on High Sierra with Xcode 9.1. After trying the dozens and dozens of suggestions on various posts, our solution was simply to change the code signing authority from one team member to another. We deleted the problem cert, and the app installed and ran on the test phone fine. Reinstalled the originally signing authority profile and compiled again... all good now. I'd recommend making this the first step in testing for this error. We tried deleting derived data and cache, reinstalling Xcode from scratch, etc. Nothing we did, not settings adjusted had any effect until we simply swapped out the signing profiles and ran a build. After that, all issues resolved.

@neilsekhon
Copy link

The only thing that worked for me:
Target > Build Phases > [CP] Embed Pods Frameworks
Uncheck "Show environment variables in build log" and "Run script only when installing"

@steewsc
Copy link

steewsc commented Dec 27, 2017

Also (this worked for me) if you are using multiple configuration (Dev, Staging, Production...) check that those configurations are using proper Pods xcconfig files (see .dev, .test and .release):
screen shot 2017-12-27 at 4 54 40 pm

@KiranJasvanee
Copy link

cleaned Derived Data and worked! 👍 :))

@furkanvijapura
Copy link

furkanvijapura commented Mar 12, 2018

I Have new issue faced in Alamofire Framwork

error Description >>

dyld: Library not loaded: @rpath/Alamofire.framework/Alamofire
  Referenced from: /Users/sunilyadav/Library/Developer/CoreSimulator/Devices/76022694-CD0A-44EC-BCF7-B2470C0CF484/data/Containers/Bundle/Application/BEC17A4E-E681-44A3-A83F-6AC58601A51C/Odin_App_Project_Swift.app/Odin_App_Project_Swift
  Reason: image not found

plz help solve this isuue

@kaiyuanheshang
Copy link

  1. deployment version do not match your min iOS version
  2. you build the framework as its mach-o as dynamic library

honghaoz added a commit to Ch0uti/ChouTi that referenced this issue Aug 11, 2018
- In Embed Frameworks, unselect `Copy only when installing` fixes the problem, this also fixes iOS example tests
- Enable tests for example project
- Reference: Alamofire/Alamofire#101 (comment)
@poonamdhomane
Copy link

poonamdhomane commented Aug 2, 2019

@grantkemp Thanks , it worked for me (y)
I was facing the same issue on xcode 10.3 with ios 12

@swapnizzle
Copy link

I encountered this issue when trying to build to my actual iOS device (but it worked fine in the simulator). I spent at least 10 hours trying to fix this bug. Tried everything in all the forums, nothing worked. But this is what finally worked for me!

  • Upgrading from iOS 13.3.1 to iOS 13.4.1

I couldn't have imagined this, but its true that iOS 13.3.1 breaks the third parties signature unless you have a paid developer account!

@jshier
Copy link
Contributor

jshier commented Apr 8, 2020

@swapnizzle Yes, that issue was tracked by #3051.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests