Dyld: Library Not Loaded: @Rpath/Libswiftdispatch.Dylib

dyld: Library not loaded: @rpath/libswiftDispatch.dylib

I am using AVG Free for Mac. Yesterday it removed libswiftDispatch.dylib to quarantine because of 'MacOS:BitCoinMiner-AS'. This seems like a false positive, see:
https://discussions.agilebits.com/discussion/86860/avg-quarantined-1password-libswiftdispatch-dylib/p2
https://forum.avast.com/index.php?topic=216164.msg1449648#msg1449648 (AVG and Avast are the same company)

So for me the fix was restoring this file from quarantine.

Library not loaded because image not found

Problem was in framework build. In target settings you have to set special parameter LD_DYLIB_INSTALL_NAME to correct value. In my case it was set to @loader_path value.

Xcode won't start after OS update

Confirming that Avast Business Antivirus broke my Xcode. To fix it, I made sure OSX was updated, then I opened Avast, opened Virus Chest, and restored libswiftDispatch.dylib then restarted my machine.

The right way to link RxSwift into a Command Line Tool

One quick way could be to have all the pods frameworks as static libs.

  1. Select Pods project on the Project Navigator
  2. Select the main Pods project above all the pods target
  3. Go to Build Settings and change Mach-O Type to Static Library. This will change all the pods to have Mach-O Type as Static Library. (Each time you run pod install this will be changed back so you might have to do it again)
  4. Clean

The advantage of this method is that your output will be a single executable.

If you want to use dynamic frameworks follow this tutorial:
https://medium.com/livefront/how-to-add-a-dynamic-swift-framework-to-a-command-line-tool-bab6426d6c31.
By using this second method your output will not be just a single executable, but you will have to provide all the dynamic frameworks as well.



Related Topics



Leave a reply



Submit