https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
s

Sawantpritish

11/22/2023, 3:39 PM
Hi, I am trying to convert my android app into KMP. I have managed to successfully convert it for android, but for ios i face following issue when i run the app
Ld /Users/transformhub/Library/Developer/Xcode/DerivedData/iosApp-bmzqjjmzttodyggylevkbunbifra/Build/Products/Debug-iphonesimulator/iosApp.app/iosApp normal (in target 'iosApp' from project 'iosApp')
cd /Users/transformhub/Downloads/kmp/AndroidViews/iosApp
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -Xlinker -reproducible -target arm64-apple-ios15.4-simulator -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.0.sdk -O0 -L/Users/transformhub/Library/Developer/Xcode/DerivedData/iosApp-bmzqjjmzttodyggylevkbunbifra/Build/Intermediates.noindex/EagerLinkingTBDs/Debug-iphonesimulator -L/Users/transformhub/Library/Developer/Xcode/DerivedData/iosApp-bmzqjjmzttodyggylevkbunbifra/Build/Products/Debug-iphonesimulator -F/Users/transformhub/Library/Developer/Xcode/DerivedData/iosApp-bmzqjjmzttodyggylevkbunbifra/Build/Intermediates.noindex/EagerLinkingTBDs/Debug-iphonesimulator -F/Users/transformhub/Library/Developer/Xcode/DerivedData/iosApp-bmzqjjmzttodyggylevkbunbifra/Build/Products/Debug-iphonesimulator -F/Users/transformhub/Downloads/kmp/AndroidViews/iosApp/../shared/build/xcode-frameworks/Debug/iphonesimulator17.0 -filelist /Users/transformhub/Library/Developer/Xcode/DerivedData/iosApp-bmzqjjmzttodyggylevkbunbifra/Build/Intermediates.noindex/iosApp.build/Debug-iphonesimulator/iosApp.build/Objects-normal/arm64/iosApp.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/transformhub/Library/Developer/Xcode/DerivedData/iosApp-bmzqjjmzttodyggylevkbunbifra/Build/Intermediates.noindex/iosApp.build/Debug-iphonesimulator/iosApp.build/Objects-normal/arm64/iosApp_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-link-runtime -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -L/usr/lib/swift -Xlinker -add_ast_path -Xlinker /Users/transformhub/Library/Developer/Xcode/DerivedData/iosApp-bmzqjjmzttodyggylevkbunbifra/Build/Intermediates.noindex/iosApp.build/Debug-iphonesimulator/iosApp.build/Objects-normal/arm64/iosApp.swiftmodule \ -framework\ shared -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/transformhub/Library/Developer/Xcode/DerivedData/iosApp-bmzqjjmzttodyggylevkbunbifra/Build/Intermediates.noindex/iosApp.build/Debug-iphonesimulator/iosApp.build/iosApp.app-Simulated.xcent -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __ents_der -Xlinker /Users/transformhub/Library/Developer/Xcode/DerivedData/iosApp-bmzqjjmzttodyggylevkbunbifra/Build/Intermediates.noindex/iosApp.build/Debug-iphonesimulator/iosApp.build/iosApp.app-Simulated.xcent.der -Xlinker -no_adhoc_codesign -Xlinker -dependency_info -Xlinker /Users/transformhub/Library/Developer/Xcode/DerivedData/iosApp-bmzqjjmzttodyggylevkbunbifra/Build/Intermediates.noindex/iosApp.build/Debug-iphonesimulator/iosApp.build/Objects-normal/arm64/iosApp_dependency_info.dat -o /Users/transformhub/Library/Developer/Xcode/DerivedData/iosApp-bmzqjjmzttodyggylevkbunbifra/Build/Products/Debug-iphonesimulator/iosApp.app/iosApp
clang: error: no such file or directory: ' -framework shared'
Following are the steps which i followed to add ios app to KMP. Once i converted my android app to KMP, i created a simple SwiftUI app and add in the same directory where the shared module is located. Then i followed each and every step mentioned in this doc like adding the New Run Script Phase, Framework Search Path, Other Linker flags & User Script Sandboxing Complete source code here I am using Xcode 15.0.1. Someone please guide on what i am doing wrong. I followed

this

video as well but same issue
j

Jacob Ras

11/22/2023, 4:03 PM
🙌 1
1
p

Pablichjenkov

11/22/2023, 4:07 PM
It sounds like a typo at the time of specifying search path and other linker flags. Make sure you don't mess up with the ' Or the answer above
s

Sawantpritish

11/23/2023, 2:42 AM
@Pablichjenkov The double quotes are automatically added by xcode in other linker flags. As soon as i enter the value and press enter, it adds double quote at the start and end
@Jacob Ras Thank you so much 👏
p

Pablichjenkov

11/23/2023, 3:05 AM
Gotcha 👍 , credits to Jacob! This one is worth saving. Just removing that now from everywhere
j

Jacob Ras

11/23/2023, 8:45 AM
Glad it helps, took me a while to figure out. Still unsure whether the documentation should be updated as I don't hear a lot of people complain about this. I filled in the feedback form on the docs site about it.
👍 1
p

Pablichjenkov

11/23/2023, 8:54 AM
For me it works with and without but I removed it anyway.
3 Views