building for iOS Simulator, but linking against dylib built for MacOSX file '/opt/local/lib/libsqlite3.dylib' for architecture i386 - ios

I get the above error message when trying to built a iOS7 project, I just cloned off BitBucket (sorry, it's private, thus can't link to it).
First off, I have tried all the solutions mentioned in linking against dylib built for MacOSX file '/usr/lib/libSystem.B.dylib' for architecture i386, Build Error - missing required architecture i386 in file, Building for MacOSX, but linking against dylib built for iOS Simulator file, and several more.
My system:
Mac OS X Mavericks; 10.9.3
XCode 5.1.1
Summary of what I've already tried:
reinstall XCode
reinstall Command Line Tools
remove entires in framework search path
remove several entries in Other Linker Flags
The error says its linking against dylib in /opt/local/lib/libsqlite3.dylib, which might indicate that it has something to do with my MacPorts installs, since only MacPort should install programs in /opt/local/, as far as I know.
Any ideas what I could've missed?

Xcode is more likely defaulting to OSX PATH environment variables to find that missing sqlite library.
Make sure to link it from your project in Xcode, pointing to iOS frameworks.

Related

Why does Xcode build for arm64 even when excluded?

I am trying to solve a problem related to Xcode 12, building for iOS Simulator, but linking in an object file built for iOS, for architecture 'arm64'
As an experiment, I wanted to see if I could configure one of my frameworks to only build x86_64 for all cases.
Here is my config:
You can see I have overridden the architectures to be x86_64 and I am excluding arm64. I am also only building active architectures only. There is no way that arm64 should ever be considered during a build.
And yet...
Here is the output of a build the very next moment. It's tons of source files that indicate they are still being compiled for arm64.
Can anyone explain this discrepancy? I am running the latest Xcode, 13.2.1, on a new M1 Max laptop.

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.

Undefined symbols for architecture x86_64: "_RCTSetLogFunction" in React Native when compiling iOS

I'm revamping an old app written in react-native (which had no changes from ~2018) to its latest versions. I migrated from react-native 0.59 to the latest 0.64
To do so, I got help from the react-native migration help tool.
I also had to update my dependencies to work with auto-link and cocoa pods. I'm fairly new to mobile and react native (my background is on web with plain react), so there might be something obvious that I'm missing.
But, while android compiles and works successfully on my Mac, I can't make the compilation to work with iOS.
As the title says, I'm getting the following error:
Undefined symbols for architecture x86_64:
"_RCTSetLogFunction", referenced from:
-[MetronomeWalletTests testRendersWelcomeScreen] in MetronomeWalletTests.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This is happening in the test project, not in the main project (or however it is called).
Things I've tried
I enabled dead code stripping as this issue suggests in both the main and the test project, for debug and release, in the "targets" section.
I also tried disabling that same setting, as this issue suggests
I tried cleaning and rebuilding
I tried adding Javascript.framework to the linked libraries
If I understand correctly, this error takes place in the phase "Link {projectName}Tests (x86_64)"
None of these have worked. I've run out of ideas.
Environment:
Mac pro with Big Sur 11.3.1 (I'm also new to Mac in general, so let me know if anything might be missing)
RN version: 0.64.2
Xcode version: 12.5.1
I get this error building both from the console and from xcode
It looks like this issue has been fixed for newly scaffolded projects. I was also facing this issue when upgrading an existing React Native project from 0.59.10 to 0.65, with the caveat that it was only happening when building in Release mode (e.g. when archiving the project in Xcode).
The solution for me is outlined in this PR - the gist is to wrap any usage of RCTSetLogFunction inside an #ifdef DEBUG block, to prevent it being run in Release mode.
I realise this might not answer the original question but I thought I'd post it here in case its helpful to anyone else.

object file built for free standing (BlackBerry Dynamics iOS SDK)

I'm having trouble to build an external pre built dependency. It throws the following error:
In /Users/me/Projects/app/ThirdParty/GoodFiles/GD.framework/GD(nondga_helper.o), building for iOS, but linking in object file built for free standing, file '/Users/me/Projects/app/ThirdParty/GoodFiles/GD.framework/GD' for architecture arm64
One of the questions that really bothers me is that I don't have a real idea what "free standing" really means. I thought it had to do with being a fat binary, but after running lipo -thin arm64 GD -o GD (and verifying with -info that it really worked) in one of my build scripts I'm still seeing the same problem.
I also tried to exclude arm64 from the simulator and x86_64 from iOS builds in Excluded Architectures as mentioned elsewhere, but that didn't work either.
Removed the Xcode 12 reason. This already doesn't compile anymore in Xcode 11.
Hi there are new BB certification files you have to add along with the usual GD.Framework files. These are documented on Blackberry website
New Xcode build system
GD.framework
BlackBerryCerticom.xcframework
BlackBerryCerticomSBGSE.xcframework
Legacy Xcode build system
GD.framework
BlackBerryCerticom.framework
BlackBerryCerticomSBGSE.framework
https://docs.blackberry.com/en/development-tools/blackberry-dynamics-sdk-ios/8_1/blackberry-dynamics-sdk-ios-devguide/Steps-to-get-started-And-iOS/rqx1490022241984/Prepare-an-app-to-use-the-static-framework
Check:
Xcode > Preferences > Locations > Command Line Tools
In my case it was set to Xcode 12 after installing Xcode 12. There is NO Xcode 12 proof solution until mid December.

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.

Resources