dyld: Library not loaded: #rpath/ ... Reason: image not found with a simple Hello world applicat - xcode

I am running into some trouble when trying to use SwiftCSV using CocoaPods and following the basic instructions.
After creating the simple Hello world console application for OS X from the template in XCode 7.3.1, I opened a terminal window and navigated to the project folder and issued a pod init
I then edited Podfile by adding the line below in the target section:
pod "SwiftCSV"
I then executed pod install, which completed successfully.
After loading the resulting .xcworkspace in XCode, when I run the application, I get the following error:
dyld: Library not loaded: #rpath/SwiftCSV.framework/Versions/A/SwiftCSV
Referenced from: /Users/paolomarini/Library/Developer/Xcode/DerivedData/BundleGeneratorSwift-egsxgxpdiuvqrfddzyzcxnwltulk/Build/Products/Debug/BundleGeneratorSwift
Reason: image not found
Program ended with exit code: 9
Note that I didn't specify a platform in Podfile as I can't figure out what the correct value is for OS X. The Podfile is as below:
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
target 'BundleGeneratorSwift' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for BundleGeneratorSwift
pod "SwiftCSV"
end
Thanks,
Paolo

Related

Xcode 14 giving build error for flurry sdk

After updating to xcode 14 I'm getting build error
error build: Undefined symbol: _OBJC_CLASS_$_Flurry
error build: Undefined symbol: _OBJC_CLASS_$_FlurrySessionBuilder
I tried cleaning pods and reinstalling pods and also I tried adding libFlurry_11.2.1.a in build phases, it didn't work.
Platform target in pods is '12.1' and for flurry below command is used
pod 'Flurry-iOS-SDK/FlurrySDK', '~> 11.2.0'
I had to contact support but for me this worked:
pod 'Flurry-iOS-SDK/FlurrySDK', '~> 12.1.1'
and the "startSession" has changed to:
Flurry.startSession(apiKey: "***", sessionBuilder: FlurrySessionBuilder.init()
.build(crashReportingEnabled: true)
.build(logLevel: .all))
PS: Your "startSession" might be different. It depends on what you need.

dyld: Library not loaded: #rpath/SwiftyStoreKit.framework/Versions/A/SwiftyStoreKit - macCatalyst

Run fails with the error for mac Catalyst
require 'cocoapods-catalyst-support'
platform :ios, '10.0'
target 'MyApp' do
use_frameworks!
pod 'SwiftyStoreKit'
end
# Configure your macCatalyst dependencies
catalyst_configuration do
# Uncomment the next line for a verbose output
verbose!
# ios '<pod_name>' # This dependency will only be available for iOS
# macos '<pod_name>' # This dependency will only be available for macOS
end
post_install do |installer|
installer.configure_catalyst
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'No'
config.build_settings['ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES'] = 'Yes'
end
end
end
end
This is my podfile ,ya this contains more pods other. than SwiftyStoreKit.
i am able to run without the SwiftyStoreKit, but if i add at then getting this error and breakpoint
dyld: Library not loaded: #rpath/SwiftyStoreKit.framework/Versions/A/SwiftyStoreKit
Referenced from: /Users/admin/Library/Caches/...../Build/Products/Debug-maccatalyst/MyApp.app/Contents/MacOS/MyApp
Reason: image not found
i am using this tool to exclude pods for mac catalyst: https://github.com/fermoya/cocoapods-catalyst-support
using
Xcode : 12.4
macOS : Big Sur 11.2.2
Integrating SwiftStoreKit with Swift Package Manager solves the issue.
If you are using Xcode 11 or later:
Click File
Swift Packages
Add Package Dependency...
Specify the git URL for SwiftyStoreKit.
https://github.com/bizz84/SwiftyStoreKit.git

Mongodb Realm installation using Xcode 11.4 with Cocoapods causes error

I created a new Swift app with xcode 11.4 and I am trying to install the pod for Mongodb Realm as per the instructions in the documentation (https://docs.mongodb.com/realm/ios/install/#ios-install). But when I do "pod install" I am getting this error:
*Installing Realm (10.0.0-beta.6)
[!] /bin/bash -c
set -e
sh build.sh cocoapods-setup
Downloading dependency: sync 10.0.0-beta.14 from https://static.realm.io/downloads/sync/realm-sync-cocoa-10.0.0-beta.14.tar.xz
Undefined symbols for architecture x86_64:
"___isPlatformVersionAtLeast", referenced from:
realm::util::(anonymous namespace)::ensure_reclaimer_thread_runs() in librealm-sync-ios-dbg.a(file_mapper.o)
realm::util::terminate_internal(std::__1::basic_stringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) in librealm-sync-ios-dbg.a(terminate.o)
realm::util::network::SecureTransportErrorCategory::message(int) const in librealm-sync-ios-dbg.a(network_ssl.o)
realm::util::network::ssl::Stream::verify_peer() in librealm-sync-ios-dbg.a(network_ssl.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)*
My podfile is as per instructions:
*platform :ios, '12.0'
target 'TEST' do
use_frameworks!
pod 'RealmSwift', '=10.0.0-beta.6'
end*
I am following the exact instructions and so why is this happening?
I would say the issue could be the podfile or that XCode was initially launched from another location (like a disk image or the downloads folder) and/or there are multiple XCode versions installed.
Podfile:
Looks like it's missing some components or may be malformed (which is why I asked if it was the exact podfile in my comments)
Here's what it should look like
project 'Test.xcodeproj'
target 'Test' do
use_frameworks!
pod 'RealmSwift', '=10.0.0-beta.6'
# ^^^ or whatever the current vers is
end
I just built a brand new MongoDB Realm project with this podfile and it worked correctly.
Also ensure your cocoapods is up-to-date as well. Either
sudo gem install cocoapods
or for us dealing with an error for that
sudo gem install -n /usr/local/bin cocoapods
Be sure you can access the latest Realm versions by ensuring your pods are up-to-date
pod repo update
XCode:
If it was initially launched from another location is won't know where it's files are. The fix is a delete and reinstall from the AppStore and/or realigning it's files with this in terminal:
xcode-select --switch /Applications/Xcode.app

Xamarin iOS Framework Binding

I am trying to create a binding for the WePay Framework:
https://github.com/wepay/wepay-ios
Following are the steps that I followed.
I installed CocoaPods.
I installed ObjectiveSharpie
I run this command in terminal : $ sharpie pod init ios WePay
And I get this error: Could not install CocoaPod
here is the full error message:
** Setting up CocoaPods master repo ...
(this may take a while the first time)
Setting up CocoaPods master repo
$ /usr/bin/git pull --ff-only
From https://github.com/CocoaPods/Specs
ee36ba4..8c6767d master -> origin/master
Updating ee36ba4..8c6767d
Fast-forward
Specs/BluetoothKit/0.3.0/BluetoothKit.podspec.json | 35 ++++++++++++++++++++++
1 file changed, 35 insertions(+)
create mode 100644 Specs/BluetoothKit/0.3.0/BluetoothKit.podspec.json
Setup completed
** Searching for requested CocoaPods ...
** Working directory:
** - Writing Podfile ...
** - Installing CocoaPods ...
** (running pod install --no-integrate --no-repo-update)
[!] Unknown option: --no-integrate
Did you mean: --no-ansi?
Usage:
$ pod install
Downloads all dependencies defined in `Podfile` and creates an Xcode Pods
library project in `./Pods`.
The Xcode project file should be specified in your `Podfile` like this:
project 'path/to/XcodeProject.xcodeproj'
If no project is specified, then a search for an Xcode project will be
made. If more than one Xcode project is found, the command will raise an
error.
This will configure the project to reference the Pods static library, add
a build configuration file, and add a post build script to copy Pod
resources.
Options:
--repo-update Force running `pod repo update` before
install
--project-directory=/project/dir/ The path to the root of the project
directory
--silent Show nothing
--verbose Show more debugging information
--no-ansi Show output without ANSI codes
--help Show help banner of specified command
error: could not install CocoaPod
Well apparently the most recent CocoaPods removed the --no-integrate option that objective sharpie uses. Downgrading cocoapods to 0.39.0 should fix your issue. It worked for us.

SQLite.swift unknown type name 'NS_ASSUME_NONNULL_BEGIN'

I'm using SQLite.swift. There's an error "Unknown type name 'NS_ASSUME_NONNULL_BEGIN'" when I build the project.
What I do:
create a demo project 'SqlDemo'
under SqlDemo/, create Podfile
use_frameworks!
source 'http://git.oschina.net/akuandev/Specs.git'
pod 'SQLite.swift', git:'https://github.com/stephencelis/SQLite.swift.git'
# pod 'SQLite.swift/Cipher', git: ... # instead, for SQLCipher support
~
then 'pod install'
after that open SqlDemo.xcworkspace
build the project
this maybe a pretty simple error. I'm new to ios dev.

Resources