Xcode 14 Xcode 13 incompatibility - swift

When I manually add the SDK that I exported in Xcode 13 to xcode 13 and xcode 14, it works for all devices without any problems. But when I export in xcode 14, it only works for simulators in xcode 13, I can't build on real devices, (in xcode 14 it works on all devices without any problems). For the SDK I exported in Xcode 14, the errors I get when I run it on real device in xcode 13 are as follows:
directory not found for option '-F/(framework path)'
Undefined symbols for architecture arm64:_objc_msgSend$subfiles
Undefined symbols for architecture arm64:_objc_msgSend$subfiles
...
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I deleted the framework search path for the directory not found error and I found a solution to it, but I couldn't find a solution for the errors I got for all the sub-files of the SDK below:
Undefined symbols for architecture arm64:_objc_msgSend$subfiles
And
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Thank you very much in advance for your comments.

After long research, I discovered the solution. Clang emits objc_msgSend in Xcode 14; previous versions of Xcode don't understand it. This needs to be disabled. Here is the link I used for the solution. Commited changes are available at this link. Big thanks to these guys.
By the way, selecting the compatible version for Xcode 14 of Command Line Tools from XCode > Preferences > Locations section, and also updating the Clang version (you can type clang -v in the terminal) to be compatible with this version.
You can add -fno-objc-msgsend-selector-stubs settings to C Flags under Apple Clang - Custom Compiler Flags from Targets > Build Setting directly from Xcode

Related

Xcode error: building for iOS Simulator, but linking in object file built for iOS

Never had a lot of problems until the time to buy Macbook Air M1. Just yesterday my app was build without any error in Xcode 12.4. I did not make any special changes and today build failed:
/Users/userName/Projects/MyApp/ios/Pods/OpenSSL-Universal/ios/lib/libcrypto.a(cryptlib.o), building for iOS Simulator, but linking in object file built for iOS, file '/Users/userName/Projects/MyApp/ios/Pods/OpenSSL-Universal/ios/lib/libcrypto.a' for architecture arm64clang: error: linker command failed with exit code 1 (use -v to see invocation)
Please can you help me, how to solve it?
Looks like a missing Arm64 simulator slice in the OpenSSL-Universal CocoaPods distribution.
Make sure that you're using the latest version with pod update and contact the OpenSSL-Universal if there's still an issue.

clang: error: linker command failed with exit code 1 (use -v to see invocation) Parse.com and Swift

so today I updated my code to Swift 2 and now my app won't run because apparently the Parse Frameworks I was using have expired or something. This is the message I get: ld:
'/Users/tripphillips1/Desktop/Spotter/Parse.framework/Parse(PFAnalytics.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture arm64
Does anyone know what this means and how i can fix it?
Thanks
Ok so I found a solution to my problem. You have to go into the Build Settings and disable the Bitcode. Simple as that. Now it runs fine.

clang: error: linker command failed with exit code 1 (use -v to see invocation)

I have developed an iOS Application with Xcode 5, release 6.
I have successfully run the application on the iOS simulator and on my iPhone 5 (iOS7 beta6)
I'm following Apple's tutorial on how to release the app onto the app store (bit complicated).
I've gotten to the point where they want me to "Archive" my project. Everytime I attempt to archive it, it gives me this error:
ld: file not found:
/Users/name/Library/Developer/Xcode/DerivedData/Mobile-cwvgezbobyhhzzccadgoqizqcmfd/Build/Intermediates/ArchiveIntermediates/trial/InstallationBuildProductsLocation/Applications/libCordova.a
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
Well, since you are using Xcode 5, Apple says on the member center:
"Xcode 5 Developer Preview cannot be used to submit apps to the iOS or
Mac App Store. Continue to use the publicly released version of Xcode
to compile and submit apps to the App Stores."
But I will show some suggestions anyway:
With Xcode, click on your project's icon on the left, select the tab Build Phases > Compile Sources and click on the "+" to check if there is some file .m to be imported.
Check if you imported all the frameworks you are using to your project.
Go to Build Settings and look for Architectures and set armv7 instead of armv6 and armv7s.
I hope this helps.

libsqlite3.0.dylib not found when build in a iPhone

I trie to put my application in a physic iPhone but xCode tell me that the library libsqlite3.0.dylib is not found.
Error code :
ld: library not found for -lsqlite3.0
clang : error: linker command failed with exit code 1 (use -v to see invocation)
I can't use libsqlite3.dylib because I deleted it by misteak and I don't find a download link.
The application work perfectly on the IOS Simulator.
Thanks for your help !!
EDIT !
I reinstalled xCode and use the sqlite3.dylib framework and work perfectly !
I reinstalled xCode and use the sqlite3.dylib framework and work perfectly !

facebook ios sdk build fails on device, works on simulator

I am trying to build an app (with ARC) that uses the facebook_ios_sdk (the latest version on github).
As recommended by Facebook, I used the build script to create a static library and then added it to the project.
Now when I build the project for an iPhone 5.1 Simulator, it works fine. However, on running it for an actual device (which is running 5.1), it gives the following build error -
ld: in ../facebook-ios-sdk/libfacebook_ios_sdk.a, file is universal but does not contain a(n) armv7 slice for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Any suggestions on how to resolve this?
You could modify the build script for static library (which was too complicated for me), or just skip the library approach:
add the Facebook sources from SDK to your project
if using ARC, go to "target->build phases->compile sources" and mark all the Facbook source files with the--fno-objc-arc flag
That's it, works for me.
One work around that worked was to change the Valid Architectures from"armv6 armv7" to just armv6