Closed vicmns closed 6 years ago
It is also failing when trying to run it on a physical device"
Showing All Messages
> Task :compileDebugIos_arm64KotlinNative
Undefined symbols for architecture arm64:
"_private_classes_<ktor-utils-ios>_io.ktor.util.DelegatingMutableSet_16", referenced from:
_kfun:jsonContent#internal in combined.o
"_private_functions_<ktor-utils-ios>_kfun:io.ktor.util.DelegatingMutableSet.iterator()kotlin.collections.MutableIterator<#GENERIC>_52", referenced from:
_kfun:jsonContent#internal in combined.o
ld: symbol(s) not found for architecture arm64
Looks like an issue with ktor-http-client. @e5l could you please take a look?
Hi, @vicmns. It looks like you try to use x64 framework on the real device.
There are two frameworks in your build directory: arm64, x64. For the simulator consider using the x64 framework, and arm64 for the real device.
Hey @e5l oh my you were right... I don't remember when I changed the gradle file outPutKind to Framework...
Thanks for the note.
A quick question... in the case that a framework it's built. How can I managed the created frameworks so I can use them without worrying about the device architecture?
I have a project where I create the framework for both platforms. But even when I import them to the xCode project, the compiler is still showing linking errors...
Undefined symbols for architecture x86_64:
Showing All Messages
"_OBJC_CLASS_$_KCDPTestJSONParsing", referenced from:
objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
As I know there is no out of the box solution. But you could try to merge frameworks into universal
framework. Maybe something like that could help: https://medium.com/swiftindia/build-a-custom-universal-framework-on-ios-swift-549c084de7c8
Consider avoid including both frameworks into the single target. I'd prefer to create 2 run configurations: for simulator and for a device.
Ok so for the sake of simplicity, I just imported the x64 framework to the project. Xcode can find the code reference so auto complete it's working.
But again when I try to compile the app on the simulator I'm getting the same error...
Showing All Messages
Ld /Users/vicmns/Library/Developer/Xcode/DerivedData/crossparser-chtnyvwqbhztzebfotbubkgdknfh/Build/Products/Debug-iphonesimulator/crossparser.app/crossparser normal x86_64
cd /Users/vicmns/Documents/git/project-awesome-o/ios
export IPHONEOS_DEPLOYMENT_TARGET=11.4
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk -L/Users/vicmns/Library/Developer/Xcode/DerivedData/crossparser-chtnyvwqbhztzebfotbubkgdknfh/Build/Products/Debug-iphonesimulator -F/Users/vicmns/Library/Developer/Xcode/DerivedData/crossparser-chtnyvwqbhztzebfotbubkgdknfh/Build/Products/Debug-iphonesimulator -F/Users/vicmns/Documents/git/project-awesome-o/ios/build/lib/main/debug/ios_x64 -F/Users/vicmns/Documents/git/project-awesome-o/ios/crossparser -filelist /Users/vicmns/Library/Developer/Xcode/DerivedData/crossparser-chtnyvwqbhztzebfotbubkgdknfh/Build/Intermediates.noindex/crossparser.build/Debug-iphonesimulator/crossparser.build/Objects-normal/x86_64/crossparser.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -mios-simulator-version-min=11.4 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/vicmns/Library/Developer/Xcode/DerivedData/crossparser-chtnyvwqbhztzebfotbubkgdknfh/Build/Intermediates.noindex/crossparser.build/Debug-iphonesimulator/crossparser.build/Objects-normal/x86_64/crossparser_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 -Xlinker -add_ast_path -Xlinker /Users/vicmns/Library/Developer/Xcode/DerivedData/crossparser-chtnyvwqbhztzebfotbubkgdknfh/Build/Intermediates.noindex/crossparser.build/Debug-iphonesimulator/crossparser.build/Objects-normal/x86_64/crossparser.swiftmodule -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/vicmns/Library/Developer/Xcode/DerivedData/crossparser-chtnyvwqbhztzebfotbubkgdknfh/Build/Intermediates.noindex/crossparser.build/Debug-iphonesimulator/crossparser.build/crossparser.app-Simulated.xcent -framework KotlinChartDataParser -Xlinker -dependency_info -Xlinker /Users/vicmns/Library/Developer/Xcode/DerivedData/crossparser-chtnyvwqbhztzebfotbubkgdknfh/Build/Intermediates.noindex/crossparser.build/Debug-iphonesimulator/crossparser.build/Objects-normal/x86_64/crossparser_dependency_info.dat -o /Users/vicmns/Library/Developer/Xcode/DerivedData/crossparser-chtnyvwqbhztzebfotbubkgdknfh/Build/Products/Debug-iphonesimulator/crossparser.app/crossparser
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_KCDPTestJSONParsing", referenced from:
objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This is how it looks in my project:
Just as note: this doesn't happen with the arm64 framework if I run it on a real device. The only thing that I had to do it was to disable Bitcode to the app config...
Could you show your build.gradle
dependencies sections?
Ok, I'm finally able to build the project on iOS. In the end I created a new iOS project and copy correctly the framework. I made a lot of changes so maybe I broke something in the way...
Thanks for the help!
Hey I'm trying to run the demo ios-test-application using xCode 9.4.1 but I'm getting the following error:
Looking at the
sh
script I found that the target for iPhone Simulator is namedios_x64
, with taskcompileDebugIos_x64KotlinNative
. Are both the same architecture and this is only a issue with naming?