Guilherme Delgado
03/03/2026, 2:03 PMembedAndSignAppleFrameworkForXcode in Xcode. Interestingly, I can navigate into it without any problems in Android Studio.
The build succeeds and the app runs fine, but when I try to navigate into the imported framework in Xcode, it always shows as “unknown” / “No such module ‘…’“. This behaviour is also inconsistent — sometimes it works, sometimes it doesn’t. I have no idea what might be causing it. I’m building debug versions (both at the scheme level and KOTLIN_FRAMEWORK_BUILD_TYPE flag).
Does anyone know how I can resolve this? From a developer experience perspective, this is making collaboration with the iOS team a bit difficult.
I’ve already checked the Framework Search Paths and they seem to be correctly configured.
Thanks in advance!Philipp Smorygo [JB]
03/04/2026, 12:13 PMFRAMEWORK_SEARCH_PATHS. Moreover, doing so might lead to duplication issues.
If after building the project in Xcode, and making sure you don't have any extra search paths, the framework in import NameOfKotlinFramework is still unresolved in Xcode, ping me back.François
03/04/2026, 12:55 PMXcode and Android Studio uses different DerivedData locations, so a project build from Android Studio won’t make the framework available for Xcode, and vice-versa.@Philipp Smorygo [JB] please make it possible to disable this feature; if the project doesn’t use CMP that’s a lot of useless data.
Philipp Smorygo [JB]
03/04/2026, 1:06 PMcidr.xcode.derived.data.override Registry value to false. However this mode is not tested and there might be some unexpected errors.François
03/04/2026, 1:16 PMPhilipp Smorygo [JB]
03/04/2026, 1:19 PMRegistry there.
https://youtrack.jetbrains.com/articles/SUPPORT-A-1030/How-to-edit-IntelliJ-IDE-Registry
But this setting will not change where Kotlin stores it's build artifacts, if they were in build directory, they will remain there.François
03/04/2026, 2:18 PMFrançois
03/04/2026, 2:18 PMGuilherme Delgado
03/04/2026, 3:57 PMFRAMEWORK_SEARCH_PATHS). I’m able to build and run the project successfully both from Xcode and Android Studio. However, in both cases I still can’t navigate into the framework or get autocomplete working. The .app bundle does contain the framework (which makes sense, since the app runs correctly).
I also noticed that this used to work at some point and then suddenly stopped. I don’t recall changing any relevant settings — I’ve only been evolving the project itself. I’ve already cleaned DerivedData on both Android Studio (Panda 2 2025.3.2 and Nightly 3.3) and Xcode (26.2.0 and 26.3.0), but the issue persists.
Is there anything else I can validate or force on my side to troubleshoot this further?Guilherme Delgado
03/04/2026, 4:05 PMFrançois
03/04/2026, 4:06 PMFrançois
03/04/2026, 4:07 PMFrançois
03/04/2026, 4:07 PMGuilherme Delgado
03/04/2026, 4:07 PMGuilherme Delgado
03/04/2026, 4:08 PMBuild finished in 27 sec, 401 ms0 warnings
Guilherme Delgado
03/04/2026, 4:08 PMGuilherme Delgado
03/04/2026, 4:10 PMlinkDebugFrameworkIosArm64 gives me:
BUILD SUCCESSFUL in 49s
24 actionable tasks: 13 executed, 2 from cache, 9 up-to-dateGuilherme Delgado
03/04/2026, 4:11 PMproblems-report.htmlFrançois
03/04/2026, 4:11 PMFrançois
03/04/2026, 4:11 PMGuilherme Delgado
03/04/2026, 4:12 PMCannot find declaration to go toFrançois
03/04/2026, 4:13 PMFrançois
03/04/2026, 4:14 PMGuilherme Delgado
03/04/2026, 4:17 PMFrançois
03/04/2026, 4:18 PMFrançois
03/04/2026, 4:18 PMGuilherme Delgado
03/04/2026, 4:18 PMFrançois
03/04/2026, 4:18 PMGuilherme Delgado
03/04/2026, 4:18 PMGuilherme Delgado
03/04/2026, 4:19 PMcan you share you Xcode build output ?Yes one sec 😉
François
03/04/2026, 4:21 PMGuilherme Delgado
03/04/2026, 5:41 PMgradlew clean and various gradle.properties flags, but nothing has worked.Guilherme Delgado
03/04/2026, 11:32 PMGuilherme Delgado
03/05/2026, 12:58 AMGuilherme Delgado
03/05/2026, 1:20 AMtasks.register("exportFrameworkForXcode") {
val module = "my-shared-module"
dependsOn(":$module:embedAndSignAppleFrameworkForXcode")
doLast {
val targetBuildDir = System.getenv("TARGET_BUILD_DIR") ?: error("TARGET_BUILD_DIR environment variable is not set")
val configuration = System.getenv("CONFIGURATION") ?: error("CONFIGURATION environment variable is not set")
val sdkName = System.getenv("SDK_NAME") ?: error("SDK_NAME environment variable is not set")
val platformName = System.getenv("PLATFORM_NAME") ?: error("PLATFORM_NAME environment variable is not set")
val derivedDataDir = targetBuildDir.substringBefore("/Build/")
val indexerDataDir = file("$derivedDataDir/Index.noindex/Build/Products/Debug-$platformName")
indexerDataDir.mkdirs()
val frameworksSourceDir = file("${rootProject.projectDir}/$module/build/xcode-frameworks/$configuration/$sdkName")
if (frameworksSourceDir.exists()) {
copy {
from(frameworksSourceDir)
into(indexerDataDir)
}
logger.lifecycle("Copied frameworks from $frameworksSourceDir into $indexerDataDir")
} else {
logger.warn("Frameworks source directory not found: $frameworksSourceDir")
}
}
}
works like a charm 👌François
03/05/2026, 5:38 AMMy header file is around 800 lines and growing. Could this be causing the issue? If so, how can I address it? It’s expected to export many classes…Not enough to make xcode crazy
François
03/05/2026, 6:54 AMif [ -d "${SRCROOT}/../shared/build/xcode-frameworks/" ]; then
# There is no completion if the shared framework is not present inside a Debug folder
cd "${SRCROOT}/../shared/build/xcode-frameworks/"
# path to your shared libary
ln -Fs "${CONFIGURATION}" "Debug"
ln -Fs "${CONFIGURATION}" "Release"
fiGuilherme Delgado
03/05/2026, 8:16 AMGuilherme Delgado
03/05/2026, 8:19 AMFrançois
03/05/2026, 8:25 AMFrançois
03/05/2026, 8:25 AMFrançois
03/05/2026, 8:26 AMFrançois
03/05/2026, 8:26 AMGuilherme Delgado
03/05/2026, 8:29 AMFrançois
03/05/2026, 8:38 AM