0Pricing
Kotlin Multiplatform Academy · Lesson

Debug 'Shared Code Not Found' Issues

Resolve the most common first-run linking problems.

Debug 'Shared Code Not Found' Issues is a free Kotlin Multiplatform Academy lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Kotlin Multiplatform Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

The Classic First-Run Wall

Almost everyone hits it once: iOS builds but Swift cannot find your shared API. Let's debug shared code not found calmly. 🛠️

Confirm the Framework Built

First, run the Gradle framework task directly. If it fails outside Xcode, the framework never existed and Swift had nothing to link.

./gradlew :shared:embedAndSignAppleFrameworkForXcode

Check the import Name

Swift must import the exact baseName set in build.gradle.kts. A mismatched name is the most common no-such-module error.

import shared

Verify the Build Phase Order

The Gradle build phase must run before Compile Sources. If it sits too low in the list, Swift compiles before the framework exists.

Framework Search Paths

Xcode needs to know where the framework lives. Check that Framework Search Paths points at the Gradle output folder for your target.

Open the Right File

Using CocoaPods but opened the .xcodeproj? Pods are missing. Close it and open the .xcworkspace instead.

Wrong Architecture Linked

An arm64 framework will not link into an x86 simulator. Make sure the framework was built for the same architecture as your run target.

Read the Build Log Top-Down

Expand the failing step in the build log and find the first error. A later linker complaint is often just a symptom of an earlier failure.

Clean Out Stale Output

Old artifacts can confuse the linker. A clean Gradle build plus an Xcode clean often clears a stubborn not-found error.

./gradlew clean

Public API Visibility

Only public Kotlin declarations cross to Swift. If a class is internal, Swift will not see it no matter how the framework links.

Most Fixes Are Wiring, Not Logic

These errors look scary but are almost always config: name, path, order, or architecture. Check those four and you'll be unblocked. ✨

Quick Check

Let's confirm a frequent cause of this error.

Recap

You learned to debug not-found errors by checking the framework built, the import name, build-phase order, search paths, and architecture. Most fixes are config, not code. 🎉

Frequently asked questions

Is the “Debug 'Shared Code Not Found' Issues” lesson free?

Yes — the full text of “Debug 'Shared Code Not Found' Issues” is free to read here on the web, and the Kotlin Multiplatform Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Kotlin Multiplatform Academy course, upgrade to CoddyKit PRO.

What will I learn in “Debug 'Shared Code Not Found' Issues”?

Resolve the most common first-run linking problems. You practise Kotlin Multiplatform Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Kotlin Multiplatform Academy?

No prior experience is required. Kotlin Multiplatform Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Debug 'Shared Code Not Found' Issues” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Kotlin Multiplatform Academy lesson?

Yes. Every Kotlin Multiplatform Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Run the Android App from Studio
  2. Open & Run the iOS App in Xcode
  3. How the iOS Framework Is Built
  4. Debug 'Shared Code Not Found' Issues
← Back to Kotlin Multiplatform Academy