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

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

Related

PhaseScriptExecution failed with a nonzero exit code when archiving only

Stuck for a week and yet can't find a solution I did everything but I can't archive the is to submit it to AppStore. It runs on Simulator smoothly with no issues but when I click archive the below error return
PhaseScriptExecution Run\ Script /Users/auser/Library/Developer/Xcode/DerivedData/Runner-evxpqziwqhmcfdeqitqdevhmsglz/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/Runner.build/Release-iphoneos/Runner.build/Script-9740EEB61CF901F6004384FC.sh (in target 'Runner' from project 'Runner')
cd /Users/auser/Documents/Mobile\ Apps/Flutter/flutterproj/ios
export ACTION\=install
export AD_HOC_CODE_SIGNING_ALLOWED\=NO
export ALLOW_TARGET_PLATFORM_SPECIALIZATION\=NO
export ALTERNATE_GROUP\=staff
export ALTERNATE_MODE\=u+w,go-w,a+rX
export ALTERNATE_OWNER\=username
export ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES\=YES
export ALWAYS_SEARCH_USER_PATHS\=NO
export ALWAYS_USE_SEPARATE_HEADERMAPS\=NO
export APPLE_INTERNAL_DEVELOPER_DIR\=/AppleInternal/Developer
export APPLE_INTERNAL_DIR\=/AppleInternal
export APPLE_INTERNAL_DOCUMENTATION_DIR\=/AppleInternal/Documentation
export APPLE_INTERNAL_LIBRARY_DIR\=/AppleInternal/Library
export APPLE_INTERNAL_TOOLS\=/AppleInternal/Developer/Tools
export APPLICATION_EXTENSION_API_ONLY\=NO
export APPLY_RULES_IN_COPY_FILES\=NO
export APPLY_RULES_IN_COPY_HEADERS\=NO
export ARCHS_STANDARD\=arm64
export ARCHS_STANDARD_32_64_BIT\=armv7\ arm64
export ARCHS_STANDARD_32_BIT\=armv7
export ARCHS_STANDARD_64_BIT\=arm64
export ARCHS_STANDARD_INCLUDING_64_BIT\=arm64
export ARCHS_UNIVERSAL_IPHONE_OS\=armv7\ arm64
export ASSETCATALOG_COMPILER_APPICON_NAME\=AppIcon
export ASSETCATALOG_COMPILER_FLATTENED_APP_ICON_PATH\=/Users/auser/Library/Developer/Xcode/DerivedData/Runner-evxpqziwqhmcfdeqitqdevhmsglz/Build/Intermediates.noindex/ArchiveIntermediates/Runner/BuildProductsPath/ProductIcon.png
export ASSET_PACK_FOLDER_PATH\=/Users/auser/Library/Developer/Xcode/DerivedData/Runner-evxpqziwqhmcfdeqitqdevhmsglz/Build/Intermediates.noindex/ArchiveIntermediates/Runner/InstallationBuildProductsLocation/OnDemandResources
export variant\=normal
/bin/sh -c /Users/auser/Library/Developer/Xcode/DerivedData/Runner-evxpqziwqhmcfdeqitqdevhmsglz/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/Runner.build/Release-iphoneos/Runner.build/Script-9740EEB61CF901F6004384FC.sh
Failed to package /Users/auser/Documents/Mobile Apps/Flutter/flutterproj.
Command PhaseScriptExecution failed with a nonzero exit code
My Podfile code:
# Uncomment this line to define a global platform for your project
platform :ios, '11.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
flutter_ios_podfile_setup
target 'Runner' do
use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
The flutter pubspec.yaml
name: application_name
description: Application Description
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1
environment:
sdk: ">=2.18.2 <3.0.0"
dependencies:
cupertino_icons: ^1.0.2
firebase_core: ^2.4.1
firebase_messaging: ^14.2.1
flutter:
sdk: flutter
flutter_launcher_icons: ^0.11.0
flutter_local_notifications: ^13.0.0
flutter_native_splash: ^2.2.16
flutter_offline: ^2.1.0
internet_connection_checker: ^1.0.0+1
url_launcher: ^6.1.7
webview_flutter: ^3.0.4
dev_dependencies:
flutter_lints: ^2.0.0
flutter_test:
sdk: flutter
flutter:
uses-material-design: true
flutter_icons:
image_path_android: "assets/playstore.png"
image_path_ios: "assets/appstore.png"
android: true
ios: true
remove_alpha_ios: true
adaptive_icon_background: "#fff"
flutter_native_splash:
#image: ""
image: assets/splash_screen.jpg
background_image: assets/splash_screen.jpg
#color: ""
android: true
ios: true
ios_content_mode: scaleToFill
android_12:
image: assets/splash_screen.jpg
icon_background_color: "#BD081B"
I m using Xcode 14.2, MacOS Ventura 13.2, pod 1.11.3, ruby 3.0.2p107
Build Phase Screenshots
I faced a similar issue before the solution was to downgrade (or install an older version of xcode) back then the issue was resolved by installing Xcode 13.2, I believe now MacOS prevents any old versions (older than 14). the issue might not be from your code, it might be from a package not compatible with the xcode building process.

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

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

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

Can't build tvOS app with Cocoapod dependencies with xctool

I have a project that has a small number of dependencies managed with Cocoapods. I can build it fine from Xcode but when I try to build it using xctool, or travisci, I get an error:
xcodebuild clean VideoStationViewer
Pods / SwiftyJSON (Debug)
✗ Check dependencies (37 ms)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Check dependencies
target 'SwiftyJSON' has bitcode disabled (ENABLE_BITCODE = NO), but it is required for the 'appletvos' platform
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1 errored, 0 warning (38 ms)
Pods / Alamofire (Debug)
✗ Check dependencies (38 ms)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Check dependencies
target 'Alamofire' has bitcode disabled (ENABLE_BITCODE = NO), but it is required for the 'appletvos' platform
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1 errored, 0 warning (38 ms)
Pods / OHHTTPStubs (Debug)
✗ Check dependencies (40 ms)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Check dependencies
target 'OHHTTPStubs' has bitcode disabled (ENABLE_BITCODE = NO), but it is required for the 'appletvos' platform
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1 errored, 0 warning (47 ms)
I'm guessing that xctool is using different parameters to build than Xcode does but not sure what is different or how to tell xctool to use those settings and then how to configure Travisci to use it too.
try adding the following snippet to the bottom of your Podfile, then do pod install:
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'YES'
end
end
end
#Campbell_Souped’s answer works great for tvOS-only projects, but if you try to also build for OS X, you’ll get an error that Bitcode is not supported. This version checks the platform before enabling Bitcode:
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.platform_name == :tvos || target.platform_name == :watchos then
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'YES'
end
end
end
end

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