◉CLAUDE LABJP
●CC 2.1.332 — In 2.1.332 (11/25), skills from MCP servers show up in the / menu as server:skill (beta)●SONNET 4.5 — Sonnet 4.5 retires from the Claude API on 11/30, 4 days left. Move to claude-sonnet-5-5●/SHIP — Users report a custom ship skill hidden behind the new built-in /ship command●NEW — New: Before Sonnet 4.5 retires, compare the 3 places its answers change●GEMINI 2.5 — Using Gemini 2.5 alongside Claude? From 12/1 requests reroute to newer models at their rates. 5 days left●JETBRAINS — Our guide to using Claude Code from JetBrains IDEs is the most-read page right now●CC 2.1.332 — In 2.1.332 (11/25), skills from MCP servers show up in the / menu as server:skill (beta)●SONNET 4.5 — Sonnet 4.5 retires from the Claude API on 11/30, 4 days left. Move to claude-sonnet-5-5●/SHIP — Users report a custom ship skill hidden behind the new built-in /ship command●NEW — New: Before Sonnet 4.5 retires, compare the 3 places its answers change●GEMINI 2.5 — Using Gemini 2.5 alongside Claude? From 12/1 requests reroute to newer models at their rates. 5 days left●JETBRAINS — Our guide to using Claude Code from JetBrains IDEs is the most-read page right now
Articles/Claude Code
⟐ Claude Code/2026-10-12Intermediate

After Moving to SPM, My App Died the Moment It Launched — Reading One dyld Line with Claude Code

Right after moving from CocoaPods to Swift Package Manager, the build passed but the app died on launch. Here is how I traced one dyld line to its cause, the fix, and how to verify it.

Claude Code295SPMdyldiOS27indie dev11troubleshooting107

I had just finished moving one of my wallpaper apps from CocoaPods to Swift Package Manager. The build was green, and the warnings were what I expected. I pressed Run on the simulator, the launch screen flashed for a moment, and I was dropped back on the home screen.

No crash dialog. No red line. Only when I opened the Xcode console did I find a single unfamiliar line:

dyld[1234]: Library not loaded: @rpath/AppLovinSDK.framework/AppLovinSDK
  Referenced from: <...> /MyApp.app/MyApp
  Reason: tried: '/usr/lib/system/introspection/AppLovinSDK.framework/AppLovinSDK' (no such file), ...

It compiled, yet something stopped it before it could even start. I want to write down how I read that line and what I changed, in case it saves someone else half a day.

How to recognize this failure

First, this is not a bug in your code. If all three of these are true, suspect this one:

  • Build and link succeed
  • The app dies at launch, before the first line of AppDelegate runs
  • The only trace is a dyld line in the console

In my setup, Crashlytics received nothing. That makes sense, since the process stops before any SDK is initialized. The quiet dashboard nearly convinced me nothing was wrong.

What was actually happening

Under CocoaPods, the Podfile decided how each SDK was brought in. With SPM, that decision splits into how the package is delivered and how the target is configured. This SDK ships as a dynamic framework, and a dynamic framework is found at launch only when two things hold:

  1. Its binary is embedded in the app's Frameworks folder
  2. The runtime search path includes that folder

My project referenced the SDK only through an ad adapter package and never linked it directly from the app target. That indirect reference is the trap: the build passes, but the framework is left out of what gets embedded.

What I handed to Claude Code, and what I didn't

project.pbxproj runs to thousands of lines, and pasting all of it would waste context. I gave Claude Code just two things:

# Resolved dependencies (which packages, which products)
grep -n "productName" MyApp.xcodeproj/project.pbxproj
 
# The runtime search path setting
grep -n "LD_RUNPATH_SEARCH_PATHS" -A3 MyApp.xcodeproj/project.pbxproj

Along with the dyld line, I added: "Build succeeds, dies right before launch. I suspect dynamic framework embedding or the runpath." The answer pointed at two things: the SDK wasn't linked directly from the app target, and LD_RUNPATH_SEARCH_PATHS lacked @executable_path/Frameworks.

That matched my hunch, but having the order of checks laid out kept me moving. Claude Code only helped me decide where to look. The builds and the on-device checks stayed with me in Xcode.

The fix (Before / After)

Three places needed attention.

# 1. Link the SDK directly from the app target
- (referenced only indirectly, through the adapter)
+ Add AppLovin-MAX-Swift-Package under Package Dependencies, then add
+ AppLovinSDK to the target's Frameworks, Libraries (Embed & Sign)
 
# 2. Runpath Search Paths in Build Settings
- LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"   <- was missing
+ LD_RUNPATH_SEARCH_PATHS = (
+     "$(inherited)",
+     "@executable_path/Frameworks",
+ );

I added the direct dependency first and checked the search path second. Fixing the path alone does nothing if the framework was never embedded.

Verify it with your own eyes

"It launched, so it's fixed" isn't enough. Look inside the build product. Two lines are all it takes:

APP="$HOME/Library/Developer/Xcode/DerivedData/<project-hash>/Build/Products/Debug-iphonesimulator/MyApp.app"
 
ls "$APP/Frameworks"                       # is AppLovinSDK.framework listed?
otool -l "$APP/MyApp" | grep -A2 LC_RPATH  # does @executable_path/Frameworks appear?

If the binary is in Frameworks and LC_RPATH shows the path, the app can find it at launch. Only after seeing both did I relax.

If it still fails

What you seeWhere to look first
Library not loaded now names a different frameworkIs that framework also only referenced indirectly?
The binary is in Frameworks but it still diesIs LC_RPATH empty, or overridden by another value?
Works on the simulator, dies on a deviceSigning and embed mode (Embed & Sign vs. Do Not Embed)
Stuck at dependency resolutionRun xcodebuild -resolvePackageDependencies first

For me, this migration did not finish in one pass. I went around the build-and-fix loop about seven times. It helps to assume a single clean pass is unlikely.

The line I drew

My mistake was treating "the build passes" and "the app launches" as the same thing.

A green build is the doorway; launching is what finishes the job.

For this migration, I now call it done only after checking Frameworks and LC_RPATH in the built product, not when the build succeeds.

If you're about to do the same migration, try those two commands before your first run. If you can see the binary and the search path there, most of that lost half day should disappear.

Share

Thank You for Reading

Claude Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

If you found this article helpful, a small tip ($1.50) would mean a lot to us. Your support helps keep this site ad-free and covers server and hosting costs.

Related Articles

⟐ Claude Code2026-11-19
My Porting Checklist Was Written in SwiftUI Terms, and It Couldn't Find a Single Purchase Item in My Objective-C Code
I built a small pipeline that hands Claude Code only the checks relevant to the file I'm editing, out of a 113KB list of 33 Android pitfalls. Three scripts, and how a SwiftUI vs Objective-C vocabulary gap let the most important items slip through.
⟐ Claude Code2026-11-06
When claude doctor Listed Four Warnings, I Sorted Them by Cause Before Fixing Anything
claude doctor ended with "4 warnings found", but I didn't need four fixes. Using the real output, here is how to spot duplicated warnings and sign-in-only info lines, group the rest by cause, and decide the order of repair.
⟐ Claude Code2026-10-22
When Only claude -p Refuses to Log In: Check the Credential Order Before You Re-Login
Interactive Claude Code works but claude -p or a script is refused? Here is where to look before running /login again, following the credential order in the official docs.