You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Swift 4.0中JJFloatingActionButton库加载失败/镜像未找到求助

Fixing the "dyld: Library not loaded" Error with JJFloatingActionButton in Xcode

Hey there! I’ve helped a bunch of new Swift devs work through this exact framework loading issue, so let’s walk through the most reliable fixes step by step:

1. Double-Check Framework Embedding & Linking (Critical!)

Xcode’s interface for handling frameworks has shifted a bit in recent versions, so let’s make sure you’re doing this correctly:

  • First, remove any existing references to JJFloatingActionButton.framework from your target’s Frameworks, Libraries, and Embedded Content section (under the General tab).
  • Drag the framework file directly into your Xcode project navigator, making sure to check the box for your target in the "Add to targets" prompt that pops up.
  • Go back to your target’s General tab, click the + button under Frameworks, Libraries, and Embedded Content, select JJFloatingActionButton.framework from your project, and set its Embed option to Embed & Sign (this is non-negotiable for dynamic frameworks like this one).

2. Wipe Xcode’s Caches & Simulator Data

Corrupted build artifacts are a super common culprit here:

  • Press Cmd+Shift+K to clean your project, then Cmd+Option+Shift+K to fully erase the build folder.
  • Delete the app from your simulator, then restart the simulator (Device > Restart).
  • For a deeper clean, delete your Derived Data: Go to Xcode > Preferences > Locations, click the arrow next to the Derived Data path, and delete the folder for your project. Restart Xcode afterward.

3. Verify Framework Paths & Build Settings

Make sure Xcode can find the framework at both compile and runtime:

  • In your target’s Build Settings, search for Framework Search Paths. Add the path to where your JJFloatingActionButton.framework is stored (e.g., $(PROJECT_DIR)/Frameworks if you keep third-party frameworks in a dedicated folder in your project root). Use a recursive path if needed.
  • Next, search for Runpath Search Paths and ensure it includes these two entries:
    • @executable_path/Frameworks
    • @loader_path/Frameworks
      These tell the app where to look for dynamic frameworks when it launches.

4. Confirm Framework Type & Installation Method

  • If you installed the framework manually, double-check that you downloaded the correct dynamic framework build (not a static one). Static frameworks don’t need embedding, but dynamic ones do.
  • If you used CocoaPods to install it: Make sure you opened the .xcworkspace file (not the .xcodeproj) after running pod install. This is a super easy mistake to make that breaks framework linking.

Quick Troubleshooting Tip

If you still see the "no such file or directory" warning after embedding, try removing the framework from your project entirely, re-downloading a fresh copy, and repeating the embedding steps from scratch. Sometimes corrupted framework files cause weird issues that are hard to spot.


内容的提问来源于stack exchange,提问作者Mwikala Kangwa

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.28 04:04:18