Xcode 14 project compile error:com.apple.xcode.tools.swift.compiler is not absolute - xcode14

There was no error in Xcode 13 but I am starting to get error below after upgraded to Xcode 14.This error doesn't seem to stop build from completing successfully.
error build: Dependency for P1:target-IMIHome_CN-cc573f8f295fdacea32720ac31b3c32d81d4253176a57d0d035f573833325806-:Debug:SwiftDriver Compilation Requirements IMIProject normal arm64 com.apple.xcode.tools.swift.compiler is not absolute (Pods/IMSThingCapability/IMSThingCapability/IMSThingCapability.framework/Modules/module.modulemap).

We had the same issue with some of our 3rd party libraries. Upgrading from framework to xcframework will solve the issue. If 3rd party library not providing xcframework then deleting "${PROJECT_DIR}/Pods" from "User Header Search Paths" solve the issue.

I finally got rid of the error messages by changing my modulemap file from "extern_c" to "system"
module ABC [system] {
...
}

Related

iOS firebase Mach-O Linker Error without cocapods

I'm trying to import Firebase into my iOS app. I followed this tutorial for doing this manually with Objective-C (as opposed to using CocoaPods).
http://www.mokacoding.com/blog/setting-up-firebase-without-cocoapods/
When I try to build my project, I get the following errors:
"Apple Mach-O Linker Error"
"Linker command failed with exit code 1 (use -v to see invocation)"
I'm familiar with the Linux CLI (less so with Macs), but I don't understand how to apply the -v flag to XCode's build process to get more info.
I've been Googling this for the last 3 hours, but every answer I find seems to be directed at users who weren't using an XCode workspace with CocoaPods.
I don't have CocoaPods installed, so I don't think this is my issue. Despite that I have converted my project and properly imported it into an XCode workspace, this still didn't solve my problem.
My app is a Swift project, and I have imported the modulemap, firebase.h, and googleServices.plist files.
I've also made my Header and Library search paths recursive for the entire project folder in an attempt to fix this.
Here's my project navigation. Although at this point I suspect it's some kind of build setting that isn't correct.
Some selected answers I've tried to apply without success:
Apple Mach -O Linker command failed
In Xcode how do I create a new workspace and add 1 project to it so that I can see the project and its files?
Framework not found GoogleToolboxForMac
Adding system header search path to Xcode
https://github.com/firebase/firebase-ios-sdk/issues/258
Apple Mach-O Linker & Ditto Error - Xcode 8
https://github.com/invertase/react-native-firebase/issues/198
https://forum.ionicframework.com/t/ios-xcode-8-apple-mach-o-linker-ld-error-group-in-xcode/89903
Upgrading to xcode 9.2 fixes this. It appears to be an issue with earlier versions not properly handling linking.
Which is misleading b/c the firebase documentation indicates it's compatible with xcode 8. But I think that's assuming you use cocoapods. If you don't, and instead try to link the obj-c frameworks you need xcode 9+
Once I knew how to examine the more verbose linking error, googling for x86_64 led me to some helpful answers.
This and other answers helped me investigate upgrading.
ld: framework not found Stripe for architecture x86_64

Xcode 9.1 - Missing required architecture x86_64 in file

I am using the library SwipeCellKit and having problems since the update to Xcode 9.1. I've recompiled the library with Xcode 9.1 and reimported the .framework in my Project. But I still can't use the classes from the library. I am getting this warning:
ld: warning: ignoring file /Users/.../Frameworks/SwipeCellKit/SwipeCellKit.framework/SwipeCellKit, missing required architecture x86_64 in file /Users/.../Frameworks/SwipeCellKit/SwipeCellKit.framework/SwipeCellKit (2 slices)
I've tried what is suggested here and set Build Active Architecture Only to No when building the library. But it doesn't help. I've also cleaned the build folder many times, which doesn't solve the problem either.
Please always use Cocoapods to install libraries for your project, it will automatically manage all dependencies.
To setup you project for cocoapods please follow steps mentioned in http://cocoapods.org/ it will make your life easier believe me.
Once you setup cocoapods successfully,
then add
pod 'SwipeCellKit'
to your Podfile
and run terminal and goto your root project directory using cd ....
then type pod install
then open your root project folder using finder
and open YOUR_PROJECT_NAME.xcworkspace file and the issue will be gone gone,
let me know if you encounter any issue installing pods.
Thanks

Xcode9 beta - Error adding openssl & library not found for -lcrypto

I am trying to add open SSL universal via cocoapods, it's installing it but on terminal, I am getting this message
The CustomerApp [Debug] target overrides the LIBRARY_SEARCH_PATHS
build setting defined in Pods/Target Support
Files/Pods-CustomerApp/Pods-CustomerApp.debug.xcconfig. This can lead
to problems with the CocoaPods installation
- Use the $(inherited) flag, or
- Remove the build settings from the target
another problem is in XCode (9 beta) build failed with this error
library not found for -lcrypto..
I am really dying because of this, have tried everything possible but no success I tried manually adding OpenSSL by downloading from site and setting the path in build settings by doing that it doesn't show error but in my swift file when import OpenSSL it says no such module.
please help me!
I think it is looking for libcrypto.a library, can you search through your project see if it exists. When you download the OpenSSL library, it should have the library along with a bundle of header files.

'Found an uxexpected Mach-O header code: 0x72613c21' when trying to export an archive to IPA.

So I recently had this issue when deploying to my device:
(null): error: bitcode_strip /Users/me/Library/Developer/Xcode/DerivedData/AppName-gximcjgdoodczthglfujqgpzamxl/Build/Products/Debug-iphoneos/Pods.framework/Pods: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/bitcode_strip exited with 1
I didn't encounter this error when deploying to a simulator though.
I found a solution here which says that I should set a user defined attribute 'STRIP_BITCODE_FROM_COPIED_FILES' to no.
Since then, I now get "Found an uxexpected Mach-O header code: 0x72613c21" when trying to export an archive.
Before the bitcode_strip issue, I was having no problem exporting archives so I'm wondering if the fix caused the current issue I'm facing, or if perhaps they are unrelated? If they are unrelated, what could actually be causing this?
here is the verbose IDEDistribution log
critical distribution log
standard distribution log
I have the same issue. I solved the problem when:
Uninstall cocoapods (I had installed cocoapods 0.39):
sudo gem uninstall cocoapods
Install cocoa pods 0.38.2:
sudo gem install cocoapods -v 0.38.2
For me, I went to TARGETS > General > Embedded Binaries
and removed my embedded binary (which was grey instead of yellow and happened to be Realm.framework)
Archive and submitted to iTunes then worked.
I wonder if it is because I had the Realm.framework embedded binary, but hadn't included the realm header or used realm yet - so maybe the compiler 'tried optimize away' my framework?

Error "library not found for" after putting application in AdMob

I am getting an error after I put my application in an AdMob. The app was working until today. The error is the following:
ld: library not found for -lGoogleAdMobAds
clang: error: linker command failed with exit code 1 (use -v to see invocation)
How can I fix this? Thank you.
I had a similar "library not found" issue. However it was because I accidentally was using the .xcodeproj file instead of the .xcworkspace file.
Sometimes you just remove the reference of the library and add reference again.
Apart from adding the Google Mobile Ads SDK and other libraries again from scratch, I would recommend you checking the Library Search Paths. There are instances when you copy or duplicate a target, Xcode decides that it needs to escape any double quotes " with a '\'. Make sure you remove all the \’s - it should look like this -
I was able to duplicate the error, by doing prefixing my path with multiple '\'.
Select your Target, go to "Build Phases" in "Link Binary With Libraries" remove ".a" file of that library.
Clean and Build.
If error related to Cocoapods as follow:
library not found for -lPod-...
You need to check Other Linker Flags and remove it from there.
Extra Information: If you have an old project that uses cocoapods. And recently you needed to add the use_frameworks! to your podfile.
cocoapods will not add the libraries to your Other Linker Flags
anymore cause its inherited. Therefore, you may need to remove those
manually from the other linker flags which they were added before
using the use_frameworks!
For my case Xcode 7, also worked in Xcode 9.1/9.2
ld: library not found for -ldAfnetworking
clang: error: linker command failed with exit code 1 (use -v to see invocation)
set Build Active architecture Only to Yes
If error is like following
ld: library not found for -lpods
I found that a file "libPods.a" which is in red colour(like missing files) was created somehow in the Framework group of the project. I just simply removed that file and everything got fine.
EDIT: Another Solution
Another Solution that I have already answered in the similar question is in this link
goto Build Phases -> Link Binary With Libraries and remove library which show errors because that library is not available in project folder
Late for the answer but here are the list of things which I tried.So it will be in one place if anyone wants to try to fix the issue.
Valid architecture = armv7 armv7s
Build Active Architecture only = NO
Target -> Build Settings ->Other Linker Flags = $(inherited)
Target -> Build Settings ->Library Search Path = $(inherited)
Product Clean
Pod Update in terminal
ld: library not found for
It is compile time error for a Static Library that is caused by Static Linker
ld: library not found for -l<Library_name>
1.You can get the error Library not found for when you have not include a library path to the Library Search Paths(LIBRARY_SEARCH_PATHS)
ld means Static Linker which can not find a location of the library. As a developer you should help the linker and point the Library Search Paths
Build Settings -> Search Paths -> Library Search Paths
2.Also you can get this error if you first time open a new project (.xcodeproj) with Cocoapods support, run pod update. To fix it just close this project and open created a workspace instead (.xcworkspace )
[Vocabulary]
As for me this problem occurs because i installed Material Library for IOS.
to solve this issue
1: Go to Build Settings of your target app.
2: Search for Other linker flags
3: Open the other linker flags and check for the library which is mention in the error.
4: remove that flag.
5: Clean and build.
I hope this fix your issue.
In my case there was a naming issue. My library was called ios-admob-mm-adapter.a, but Xcode expected, that the name should start with prefix lib. I've just renamed my lib to libios-admob-mm-adapter.a and fixed the issue.
I use Cocoapods, and it links libraries with Other linker flags option in build settings of my target. The flag looks like -l"ios-admob-mm-adapter"
Hope it helps someone else
Simply, GoogleAdMobAds.a is missing in project target.
For me it was libAdIdAccessLibrary.a Please check attached screenshot
In the case of ld: library not found for -{LIBRARY_NAME} happened because the library file(s) is not existing.
Check the library path on your application targets’ “Build Phases”
Library Search Paths tab.
The library file(s) path must be according to the real path for example if your file(s) in the root of the project you must set the path like $(PROJECT_DIR)
I know this is a bit old, but I just hit a similar issue and running 'pod update' fixed this for me. My library error was with AFNetworking...
Just be careful doing pod update if you don't use explicit versions in your pod file.
This error is very weird.
I had this error with -ldAfnetworking and I only copy my project in other path and works.
I tried renaming my build configuration Release to Production, but apparently cocoa pods doesn't like it. I renamed it again to Release, and everything builds just fine.
#raurora's answer pointed me in the right direction. I was including libraries in my "watchkitapp Extension/lib" path. In this case, the Library Search Path needed to be escaped with a '\', but the linker didn't seem to understand this. To fix / work-around the issue, I moved my lib path up one level so it was no longer in a directory that contained a space in the name.
I just update the pod file 'pod update' and it start to work for me normally.
Running 'pod update' in my project fixed my problem with the 'library not found for -lSTPopup' error.
Remarking Trevor Panhorst's answer:
"Just be careful doing pod update if you don't use explicit versions in your pod file."
Easy solution. Here's how I'd fix the issue:
Go to the directory platforms/ios
Then, execute the command pod install
That's it. This should install the missing library.
Cleaned Build Folder
Restarted XCode
Went away...
I was getting similar bugs on library not found. Ultimately this is how I was able to resolve it
Before starting with Xcode Archive, used flutter build iOS
Changed the IOS Deployment Target to a higher target iOS 11.2 . Earlier I had something like 8.0 which was giving all the above errors.
Made sure that the IOS deployment targets in Xcode are same in the Project, Target and Pods
I was also facing the same issue and spent more than 24 hours to solve this, I tried everything from the above solutions but what finally works for me is
Build settings -> Select Target
Basics
User-defined
Change the VALID_ARCHS to arm64
Dude you need a reinstallation.
Delete simply "rm -rf" pods.
Install Pods "bundle exec pod install"
Works well then.
the same here, but in my case was resolved with answer the kenorb

Resources