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

Xcode 12.4运行APP时dyld加载glog.framework失败及命令行启动闪退问题求助

Fix for "dyld: Library not loaded: @rpath/glog.framework/glog" in Xcode 12.4

Hey Hugo, let's work through this glog framework loading error you're hitting with Xcode 12.4 and the iOS 13.3 simulator. This "image not found" issue usually boils down to framework linking/embedding misconfigurations or stale cached data. Here are step-by-step fixes to try:

1. Verify and Refresh CocoaPods Dependencies (if using Pods)

Since glog is often pulled in via CocoaPods (e.g., as a dependency for Firebase or other libraries), start here:

  • First, double-check your Podfile includes glog (or the parent library that depends on it).
  • Run these commands in your project root to reset pods:
    pod deintegrate
    pod install
    
  • Close and reopen Xcode afterward—sometimes Xcode needs a fresh start to pick up new pod configurations.

2. Check Xcode Build Settings

Make sure your project is set up to find and load glog correctly:

  • Go to your target's Build Settings:
    • Ensure Framework Search Paths includes $(inherited) (to pull in paths from Pods) and the direct path to glog's framework directory (e.g., $(PROJECT_DIR)/Pods/glog).
    • Confirm Runpath Search Paths is set to:
      @executable_path/Frameworks
      @loader_path/Frameworks
      
      These paths tell dyld where to look for frameworks referenced with @rpath.

3. Clear Cached Data

Stale derived data or simulator cache can cause weird loading issues:

  • Delete Xcode's Derived Data:
    rm -rf ~/Library/Developer/Xcode/DerivedData
    
  • Reset your iOS simulator:
    • Open the simulator, go to Device > Erase All Content and Settings
    • Or run this command in Terminal:
      xcrun simctl erase all
      

4. Fix Command-Line Launch Crashes

When running via command line, add debug logging to see what's going wrong:

  • Launch your app with the DYLD_PRINT_LIBRARIES environment variable to track framework loading:
    DYLD_PRINT_LIBRARIES=1 xcrun simctl launch booted com.your.app.bundle.id
    
    Replace com.your.app.bundle.id with your app's actual bundle identifier. This will print every library dyld tries to load—you’ll see exactly where it fails to find glog.

5. Confirm Framework Embedding

Make sure glog is being copied into your app bundle:

  • Go to your target's Build Phases:
    • Check Link Binary With Libraries—glog.framework should be listed here.
    • Check Embed Frameworks—add glog.framework here if it's missing, and set its Embed option to Embed & Sign (for dynamic frameworks).
  • After updating, build your app again and check the app bundle: right-click the app in Xcode's Products folder > Show in Finder, then right-click the app > Show Package Contents—verify Frameworks/glog.framework exists.

If none of these steps work, double-check that glog was built correctly for the iOS simulator target (sometimes arch mismatches can cause this). You can try re-building the glog framework manually if it's not coming from CocoaPods.

内容的提问来源于stack exchange,提问作者Hugo Fernandes

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.04.29 15:22:50