Soundcloud Apple Mach-O Linker error when running from Iphone device - ios

My program runs fine when i use the simulator however, when i try run it on an ios Device i get the apple mach-o linker error. This only started to happen when i added the soundcloud api
This is the error I'm getting:

This means the library you are linking against (Soundcloud) was not built for arm64. It looks like some of your other dependancies (like JSONKit) were also not built for arm64.
If you change your build architectures to only build for the architectures you can support (armv7, armv7s), that is one way of fixing the problem.

Related

Xcode12 - building for iOS Simulator, but linking in object file built for macOS, file 'dir/SomeFile.a' for architecture x86_64

Getting linker error in Xcode 12 when I am trying to build my large iOS app (hybrid, swift+objc). The application is building fine for real device, but It gives linker error when I am trying to run in Simulator directly with Debug configuration.
I have tried all possible solutions in other post here, but unfortunately it didn't work. Although the error in other post is different. I have checked Build for active architectures only to YES for Debug configs and NO for Release configs.
Other post error,
building for iOS Simulator, but linking in object file built for iOS, for architecture arm64
My error,
building for iOS Simulator, but linking in object file built for macOS, file for architecture x86_64
How can I resolve this issue? I need to run in both iOS real device and Simulator.
Wherever you got your library you should request the library that is compiled for iOS Simulator, not for macOS, although they have the same binary architectures that are returned via lipo -info <file>.
You can verify that your static (.a) or dynamic library (.dylib) is compiled for iOS Simulator using this command:
otool -l <path-to-library> | grep platform
The output means the following:
platform 7 - iOS Simulator
platform 6 - Mac Catalyst
platform 4 - watchOS
platform 2 - iOS
platform 1 - macOS
Here is the full definition of the enum for platform.
Try to add x86_64 in VALID_ARCHS in the User-defined section in Build Settings.

Build iOS framework towards My Mac with Xcode 11.2 report errors

I upgrade my xcode recently.
When I build my iOS frameworks towards My Mac, most of them works fine. However one framework build failed. The error as follow:
My Mac doesn’t support any of XXX.framework’s architectures. You can add My Mac’s x86_64h architecture to XXX.framework’s Architectures build setting.
I have tried add x86_64h, x86_64, and arm64e to valid architecture, but it doesn't work.
I also tried to compare build settings between these frameworks, but failed to find out an solution.
Any suggestion to solve this problem?
I had the same issue, then I changed Valid Architectures to arm64 x86_64.
After this, I was able to build the framework and use it.

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

Getting errors compiling an iOS App Using CorePlot 1.5.1

So, I am trying to build and run an App on my iPhone 5 device. But "suddenly" (Was working fine until I ran archive to submit to iTunes connect) it is failing with errors. The app is using CorePlot graphing library and the error seems to be occurring in that library.
So, the error is
Text
ld: warning: ignoring file
path/to/libCorePlot-CocoaTouch.a,
file was built for archive which is not the architecture being linked
(armv7):
path/to/libCorePlot-CocoaTouch.a
I can understand the error. It basically says that the library was built not for armv7 architecture.
However, to confirm this I ran this terminal command against the static library.
lipo -info libCorePlot-CocoaTouch.a
and the result is,
Architectures in the fat file: libCorePlot-CocoaTouch.a are: armv7 armv7s i386 x86_64 arm64
I can't see a reason why this isn't running. The project compiles and runs on simulator but when I change to device it starts to fail.
What have I tried so far?
Seeking for solutions on Google - Failed
Cleaning project and running it again.
Quitting XCode and restarting it.
Shutting down Macbook and then restarting it.
Downloading CorePlot 1.5.1 source files and rebuilding the binary files.
After all above steps and many more. I have same error again and again. I don't know what am I done wrong.
Environment Specs:
MacBook Pro running OSX 10.9.2
XCode 5.1.1
Project > Build Settings > Architectures > Standard architectures (armv7, armvts, arm64)
Base SDK > Latest iOS (iOS 7.1)
iPhone 5 with iOS 7.1.1
If it helps, I am sharing the exact binary I am using right now with my app.
CorePlot Binary which is being used.
Any idea about what am I doing wrong? I know there is like a silly mistake somewhere. But not sure where. Any extra info please comment. I will provide it straight away. I was about to upload my App to iTunes connect.

Apple Mach-O Linker Error (Cannot built my app when i select iOS device)

I built an app that uses ZbarSDK for barcode scan, the app works fine when running over the simulator, but when I try to archive it on a real device this error shows up:
You are compiling your app for the armv7s architecture but ZbarSDK isn’t compiled for armv7s. So either compile ZbarSDK for armv7s (preferred) or don’t compile your app for armv7s.

Resources