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

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.

Related

Leveldb framework not found swift

I recently upgraded my Xcode to the latest version and a big project I was working on had to be updated and fixed. Once the code updated I tried to run the app on simulator and iOS device but I always get the same error and I don't know where it comes from. I know it means the leveldb framework is missing but I don't find it anywhere on the internet. I am using Firebase.
Here's the error I get
ld: framework not found leveldb
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I would really appreciate if one of you knew how to fix this! Thanks

clang: error no such file or directory: */Debug-iphonesimulator/MailCore/MailCore

I am using mailcore2 in my ios app from fetching my gmail account emails on my device. I have changed the ios sdkversion from 6.1 to 6.0 in the mailcore2 scripts bcz I am trying to compile and run the app using iPhone simulator 6.0 which uses ios sdkversion 6.0. Doing so I am getting the following clang error.
clang: error: no such file or directory: '/Users/shujaat/Library/Developer/Xcode/DerivedData/MyTestApp-ditognlaoajwldfliplqecnxqbfj/Build/Products/Debug-iphonesimulator/MailCore/MailCore'
While trying to compile and run my app using iphone simulator 6.1 (uses ios sdk 6.1), with no changes in the ios sdk version in the shell scripts, I am getting the following error:
/bin/sh /Users/shujaat/Documents/WemoTech/Products/WantList/sourcecode/ThirdPartyLib/MailCore2/Externals/builds/workdir/20130930192723/src/libetpan/build-mac/update.sh
configuring
running prepare-cyrus-sasl.sh
prepare sources
patching file lib/client.c
building tools
generated makemd5i386 properly
building for iPhoneOS - armv7
CONFIGURE FAILED
Command /bin/sh failed with exit code 1
These issues are driving me crazy for the last couple of days. Need your help.
Go to your main project target->"Build phases"->"Target dependencies" add mailcore2 ios
You need to read Check Adding MailCore to Your iOS Project carefully.
These issues are fixed now. I want to explain what I did to get rid of them for others facing same issues:
I made a separate project, and made mailcore2 as a part of it (didn't include the #import line in any of the project files at first). I compiled and run the project and copied the resultant mailcore 2 from it to my original project. It's compiling and running fine now.

unable to build xcode4.3 because getting command failed with exit code 1

I am new to develop iphone and phonegap also. Now I wants to create iphone app using Phonegap. So I installed Phonegap 2.0 in my lion mac. Now I want to run the UIWebView using phonegap. I have followed this link for my guidelines:
When I run the project I got the below error in XCode 4.3:
clang: error: unsupported option '--DNS_BLOCK_ASSERTIONS=1'
Command/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
I have attached the screen shot of the error.
Please help me to solve the issue and run UIWebview in phonegap 2.0 CordovaLib.
the error is
clang: error: unsupported option '--DNS_BLOCK_ASSERTIONS=1'
which should be -DNS_BLOCK_ASSERTIONS=1
go to the build settings, search of "other c flags"/"other c++ flags", and change --DNS_BLOCK_ASSERTIONS=1 to -DNS_BLOCK_ASSERTIONS=1

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

object file format invalid or unsuitable

I have two Xcode installed on my iMac (OSX 10.6.8), Xcode 3.1.4 and Xcode 3.2.6.
I created a new „empty view” project, it builds and runs in simulator fine with both Xcode.
BUT when I want to build to DEVICE then I got this error in Xcode 3.2.6:
.../build/Debug-iphoneos/JustaTest.app: object file format invalid or unsuitable
Command /usr/bin/codesign failed with exit code 1
It still works fine in Xcode 3.1.4 but it seems that the JustaTest.app file generated by Xcode 3.2.6 is not compatible with codesign.
Does anyone know how to tell Xcode 3.2.6 to generate codesign compatible app file?
Or how to get a new codesign which can sign app files generated by Xcode 3.2.6?
Thanks a lot.