Build successfully for iOS Device But Build Error for iOS Simulator (Get other linker flag error) - ios

I have been facing this lingering issue. When I try to Build the project by selecting iOS device in my Xcode it builds the code with out any error but when I trying the same with iOS simulator it shows me the following error.
ld: library not found for -lPods-ClientService
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The issue is that you are trying to use a library that you created yourself or downloaded from a 3rd party with your product, and the linker either not find it, or it does not contain a valid slice for the architecture / platform that you are trying to link.
It is most likely that the library is just an arm library, without an intel slice.
If you are building it yourself, this may be because the library and your app are in two separate Xcode projects. If you integrate them into a single project, the build system should take care of making sure that the library gets built for the correct platform and architecture(s) when building your app.

Related

Unable to build HERE SDK Premium for ios-arm64-simulator

Having trouble building HERE SDK for iOS (Premium 3.19) for an ios-arm64-simulator. The error produced by Xcode 13 on an M1 pro processor is:
ld: building for iOS Simulator, but linking in dylib built for iOS, file 'Pods/HEREMaps/framework/NMAKit.xcframework/ios-arm64/NMAKit.framework/NMAKit'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
After some research and testing it looks like HERE SDK's XCFramework folder as well as the Cocoapod configuration only include ios-arm64 and ios-x86_64-simulator. It looks like the podspec is attempting to fix this by overriding the target app's iOS simulator excluded architectures (adding excluded architecture "arm64"). This likely works fine in cases where only Cocoapod sourced libraries that include x86_64 are used in the target app. However, it's a problem when using libraries from other sources where there is no roll back option to x86_64 simulators (e.g. Swift Package Manager).
Is there a way to use lipo to generate ios-arm64-simulator from the two existing framework builds? Or is this something where ios-arm64-simulator needs to be built as another configuration from the HERE SDK source?
Let me tell you that we have already located this situation in the SDK and our team in charge of the SDK is working very hard to provide a solution to this problem in the next release of HERE SDK Premium.

When publishing a project (swift 4.2) in the AppStore, an error occurs when linking the libPrinterSDK library.a

All kind time of day. The project on Swift uses the SDK for blueTouth printer Mini Thermal Printer POS-5805DD. The libPrinterSDK library (included with the printer) has been added to the root of the project.a and the PrinterSDK header file.h, header-file is connected via bridge, when you run the project on a real device-everything works correctly, no errors occur. But when you try to build a project to upload to the AppStore, at the very end when linovke libprintersdk library.a an error appears:
ld: bitcode bundle could not be generated because
'/Users/ivan/Documents/MyProject/PrinterSDK/libPrinterSDK.a
(GCDAsyncSocket.o)' was built without full bitcode. All object files
and libraries for bitcode must be generated from Xcode Archive or
Install build file
'/Users/ivan/Documents/MyProject/PrinterSDK/libPrinterSDK.a' for
architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
If there is any experience of building a project with libPrinterSDK files.a and PrinterSDK.h, I would really appreciate any help. Thanks.
Im not sure your project has turn Enable Bitcode off yet, if not, try to set No like this image below and Archive project again.
If it doesn't work, you can refer here

Unable to build Xcode Project: clang error: linker command failed

I have a Unity project which I have successfully built for Android without issue. When trying to build for iOS I am encountering an issue once the project is in Xcode.
Unity compiles without any errors and creates an Xcode project.
Upon opening the Xcode project I have NO simulators available. I can get these simulators by selecting ios in the Supported Platforms section, at which point simulators become available - originally Supported Platforms is set to iphoneos. This seems extremely odd behaviour to me, and suggests something larger going wrong.
After getting a simulator to select I get the following error when trying to compile/run/build:
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The full error is available on Pastebin (too large to post directly on here):
https://pastebin.com/3fYR8fE3
I'm really at a loss on what I can do. I have tried a number of things, including:
Building from Unity as Debug and Release
Building from Unity with 'Symlink Unity Libraries' on and off
Building from Unity with .Net 3.5 and .Net 4.* flavours
Manually adding the libiconv.2.dylib file in the linked frameworks tab as the .tbd equivalent
Setting the target minimum version of iOS to 9.0 (negates the need for libiconv.2.dylib entirely)
I am using latest versions of everything:
Unity 2018.2.17f1
Xcode 10.1
It seems like you have the library il2cpp built for another architecture, have you tried to change your target's "Build Settings > Build Active Architectures Only" to "No"?
However I made some researches and it seems that Unity for iPhone doesn't deploy on simulator. It only works on device or in the Unity editor. Check this link out

Xcode building while device is connected but not archiving

I am trying to build the project using this as basis :
GitHub code
but it is giving me error when i am trying to archive the project, while running it directly on device is okay. If i turn bitcode to off it makes the build but exit with some error on the iphone because dlib library is not being added needed for detection.
ld: bitcode bundle could not be generated because 'path/lib/libdlib.a(threads_kernel_shared.o)' was built without full bitcode. All object files and libraries for bitcode must be generated from Xcode Archive or Install build for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I can see there is some problem in generation of dlib library but have no idea how to solve it up.
If anyone can guide me through it, i will be really thankful for the guidance. Thank you.
Try this - Worked for me
Goto Build Settings -> Enable Bitcode -> Select 'No'
And Archive with Generic Device selected.
Select Generic iOS Device while archiving

Linker error when building Unity3D mobile project for iOS in Xcode

I recently updated my OSX to El Capitan and, because of an issue with my previous version of Unity (v 5.0.1 I believe), I was forced to update to the latest version (5.2.1f1). Now, when I build for iOS, I get the following error during the linking process:
ld: framework not found FBSDKCoreKit for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I am using the Soomla library for in-app purchases and social integration, as well as Parse for the online database. I believe at least one of these libraries could be responsible for this, since they both contain Facebook-related code. In any case, I can't figure out what I need to try next. Both plugins have been updated to their latest versions.
I attempted building with the Mono2x scripting backend first, as usual. Then, I tried changing it to IL2CPP and tried compiling for armv7, arm64, and the Universal architecture options. Nothing worked.
I also tried manually adding the FBSDKCoreKit framework file downloaded from https://developers.facebook.com/docs/ios. This also didn't work, except this time I got a slightly different error:
ld: framework not found FBSDKCoreKit clang: error: linker command
failed with exit code 1 (use -v to see invocation)
I'm not sure why it would say this when I explicitly add the framework into the Xcode project. Could anyone give me any insight?

Resources