How to specify specific source for a certain pod? - ios

Although I believe this is harmless, warnings quite irk me. So I'm using a very specific version of TwilioChatClient together with TwilioClient. These two specific versions are what Twilio have been using in their sample projects.
Anyways, the warning when installing / updating pods:
[!] Found multiple specifications for TwilioChatClient (1.0.9):
- /Users/XXX/.cocoapods/repos/master/Specs/7/d/e/TwilioChatClient/1.0.9/TwilioChatClient.podspec.json
- /Users/XXX/.cocoapods/repos/twilio/TwilioChatClient/1.0.9/TwilioChatClient.podspec
[!] Found multiple specifications for TwilioChatClient (1.0.8):
- /Users/XXX/.cocoapods/repos/master/Specs/7/d/e/TwilioChatClient/1.0.8/TwilioChatClient.podspec.json
- /Users/XXX/.cocoapods/repos/twilio/TwilioChatClient/1.0.8/TwilioChatClient.podspec
[!] Found multiple specifications for TwilioChatClient (1.0.7):
- /Users/XXX/.cocoapods/repos/master/Specs/7/d/e/TwilioChatClient/1.0.7/TwilioChatClient.podspec.json
- /Users/XXX/.cocoapods/repos/twilio/TwilioChatClient/1.0.7/TwilioChatClient.podspec
[!] Found multiple specifications for TwilioChatClient (1.0.6):
- /Users/XXX/.cocoapods/repos/master/Specs/7/d/e/TwilioChatClient/1.0.6/TwilioChatClient.podspec.json
- /Users/XXX/.cocoapods/repos/twilio/TwilioChatClient/1.0.6/TwilioChatClient.podspec
[!] Found multiple specifications for TwilioChatClient (1.0.5):
- /Users/XXX/.cocoapods/repos/master/Specs/7/d/e/TwilioChatClient/1.0.5/TwilioChatClient.podspec.json
- /Users/XXX/.cocoapods/repos/twilio/TwilioChatClient/1.0.5/TwilioChatClient.podspec
[!] Found multiple specifications for TwilioChatClient (1.0.4):
- /Users/XXX/.cocoapods/repos/master/Specs/7/d/e/TwilioChatClient/1.0.4/TwilioChatClient.podspec.json
- /Users/XXX/.cocoapods/repos/twilio/TwilioChatClient/1.0.4/TwilioChatClient.podspec
My podfile:
project 'Proj/Proj.xcodeproj'
source 'https://github.com/CocoaPods/Specs'
source 'https://github.com/twilio/cocoapod-specs'
platform :ios, '10.0'
use_frameworks!
target 'Proj' do
pod 'TwilioClient', '~>1.2' # Twilio Call Framework
pod 'TwilioChatClient', '1.0.4' # Twilio Chat Framework
target 'MobileMedTests' do
inherit! :search_paths
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.0'
end
end
end
end
target 'ProjUITests' do
end
I think specifying two kinds of sources (which are both necessary) causes these warnings. Is there a way to put the specific source right beside the pod?

In fact, your problem comes from the fact that you have added the twilio repo to your pod source with this line :
source 'https://github.com/twilio/cocoapod-specs'
So when you type pod repo, you obtain something like :
master
- Type: git (master)
- URL: https://github.com/CocoaPods/Specs.git
- Path: /Users/cyrille/.cocoapods/repos/master
twilio
- Type: git (master)
- URL: https://github.com/twilio/cocoapod-specs
- Path: /Users/cyrille/.cocoapods/repos/twilio
And when you execute pod install, cocoa pods can find a version of this lib both in master's cocoapods repo and in twilio's one... which make the warning.
To remove this warning, remove this line from your Podfile :
source 'https://github.com/twilio/cocoapod-specs'
In a terminal execute the following commands :
pod repo remove twilio
and then :
pod update
You should get the following with no more warnings :
Analyzing dependencies
Removing TwilioClient
Downloading dependencies
Installing TwilioChatClient 2.2.0 (was 1.0.4)
Installing TwilioSDK (1.2.9)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 2 dependencies from the Podfile and 2 total pods installed.

just wanted to give a bit of background on the warnings you saw here. We use a separate cocoapods repository during beta testing (https://github.com/twilio/cocoapod-specs) but began publishing to the global cocoapods repository soon after GA when 1.x was released.
We did not stop publishing to our existing cocoapod-specs repository for the rest of the 1.x releases because it would have been a breaking change to existing customers using the beta source line who wished to upgrade if they did not also have the global cocoapods repository declared. This is what cocoapods is warning about, that the same pod with a same version is defined in two places. The podspecs are identical, so this will not cause issues when using any of the versions of the SDK for which this warning shows up.
As of 2.x, we have been publishing chat only to the global repository so that is why the warnings stop with the 1.x series of releases.

First, You need SDK also.I installed pod on my project now. It works fine. Look up this link
http://cocoapods.org/?q=Twilio
Pod Code
project 'Proj/Proj.xcodeproj'
source 'https://github.com/CocoaPods/Specs'
source 'https://github.com/twilio/cocoapod-specs'
platform :ios, '10.0'
use_frameworks!
target 'Proj' do
pod 'TwilioSDK', '1.2.9'
pod 'TwilioChatClient'
target 'MobileMedTests' do
inherit! :search_paths
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.0'
end
end
end
end
target 'ProjUITests' do
end

source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
platform :ios, '10.0' # (or whatever version you want)
target 'Project Name' do
pod 'TwilioSDK', '1.2.9'
pod 'TwilioChatClient'
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.0'
config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
end
end
end

Related

"Your Podfile requires that the plugin `cocoapods-patch` be installed" after XCode 13 update

After getting a new M1 Macbook with MacOS Monterey 12.2.1 (21D62) and XCode Version 13.4.1 (13F100) when I run cd ios and pod install in a React Native project I'm getting:
[!] Your Podfile requires that the plugin cocoapods-patch be installed. Please install it and try installation again.
I already searched for solutions.
Globally installing 'cocoapods-patch' doesn't make any difference.
There are no new updated for 'cocoapods-patch' since last year.
Apparently it's possible to force XCode 12 to work in Monterey and this should work, but it's not a proper solution. Eventually I will need to update to XCode 13.
Any ideas? Thank you.
Podfile:
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/#react-native-community/cli-platform-ios/native_modules'
require_relative '../node_modules/react-native-unimodules/cocoapods.rb'
# source 'https://github.com/CocoaPods/Specs.git'
source 'https://cdn.cocoapods.org/'
platform :ios, '12.1.0'
plugin 'cocoapods-patch'
target 'MyProject' do
use_unimodules!
config = use_native_modules!
pod 'Google-Mobile-Ads-SDK'
pod 'GoogleToolboxForMac/NSString+HTML', '2.3.0'
pod 'Mantle', '2.1.6'
pod 'tealium-swift', '2.6.0' # all modules
pod "tealium-react-native-swift", :path => '../node_modules/tealium-react-native/tealium-react-native-swift.podspec'
use_react_native!(
:path => config[:reactNativePath],
# to enable hermes on iOS, change `false` to `true` and then install pods
:hermes_enabled => true
)
permissions_path = '../node_modules/react-native-permissions/ios'
pod 'Permission-AppTrackingTransparency', :path => "#{permissions_path}/AppTrackingTransparency"
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
# use_flipper!()
# post_install do |installer|
# react_native_post_install(installer)
# end
# end
post_install do |installer|
react_native_post_install(installer)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
# Apple Silicon builds require a library path tweak for Swift library discovery or "symbol not found" for swift things
installer.aggregate_targets.each do |aggregate_target|
aggregate_target.user_project.native_targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['LIBRARY_SEARCH_PATHS'] = ['$(SDKROOT)/usr/lib/swift', '$(inherited)']
config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
end
end
aggregate_target.user_project.save
end
# Flipper requires a crude patch to bump up iOS deployment target, or "error: thread-local storage is not supported for the current target"
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
end
end
# ...but if you bump iOS deployment target, Flipper barfs again "Time.h:52:17: error: typedef redefinition with different types"
# We need to make one crude patch to RCT-Folly - set `__IPHONE_10_0` to our iOS target + 1
# https://github.com/facebook/flipper/issues/834 - 84 comments and still going...
`sed -i -e $'s/__IPHONE_10_0/__IPHONE_12_0/' #{installer.sandbox.root}/RCT-Folly/folly/portability/Time.h`
end
end
log after 'pod install --verbose':
Installing unimodules:
expo-constants#11.0.2 from ../node_modules/expo-constants/ios
expo-file-system#11.1.3 from ../node_modules/expo-file-system/ios
expo-image-loader#2.2.0 from ../node_modules/expo-image-loader/ios
expo-in-app-purchases#11.0.1 from ../node_modules/expo-in-app-purchases/ios
expo-modules-core#0.2.0 from ../node_modules/expo-modules-core/ios
unimodules-app-loader#2.2.0 from ../node_modules/unimodules-app-loader/ios
unimodules-core#7.1.2 from ../node_modules/#unimodules/core/ios
unimodules-react-native-adapter#6.3.9 from ../node_modules/#unimodules/react-native-adapter/ios
unimodules-task-manager-interface#6.2.0 from ../node_modules/unimodules-task-manager-interface/ios
$ /Users/ramiro/.nvm/versions/node/v14.15.0/bin/node -e try {console.log(require('#react-native-community/cli').bin);} catch (e)
{console.log(require('react-native/cli').bin);}
/Users/ramiro/mobile-darwin/node_modules/#react-native-community/cli/build/bin.js
RNFBAnalytics: Using default Firebase/Analytics with Ad Ids. May require App Tracking Transparency. Not allowed for Kids apps.
RNFBAnalytics: You may set variable `$RNFirebaseAnalyticsWithoutAdIdSupport=true` in Podfile to use analytics without ad ids.
Using firebase.json from '/Users/ramiro/mobile-darwin/firebase.json'
Adding a custom script phase for Pod RNFBApp: [RNFB] Core Configuration
Adding a custom script phase for Pod RNFBCrashlytics: [RNFB] Crashlytics Configuration
react-native-appsflyer: Using default AppsFlyerFramework.You may require App Tracking Transparency. Not allowed for Kids apps.
react-native-appsflyer: You may set variable `$RNAppsFlyerStrictMode=true` in Podfile to use strict mode for kids apps.
Auto-linking React Native modules for target `NewEspresso`: BVLinearGradient, RNBootSplash, RNCAsyncStorage, RNCMaskedView, RNColorMatrixImageFilters, RNDeviceInfo, RNFBAnalytics, RNFBApp, RNFBCrashlytics, RNFBFirestore, RNFBMessaging, RNFBPerf, RNFBRemoteConfig, RNFS, RNGestureHandler, RNKeychain, RNLocalize, RNPermissions, RNSVG, RNScreens, RNSentry, RNShare, RNSharedElement, RNVectorIcons, apptentive-react-native, react-native-ad-manager, react-native-appsflyer, react-native-background-downloader, react-native-background-timer, react-native-blur, react-native-mmkv-storage, react-native-netinfo, react-native-pager-view, react-native-photo-manipulator, react-native-safe-area-context, react-native-slider, react-native-track-player, react-native-view-shot, react-native-webview, and tealium-react-native
Preparing
[!] Your Podfile requires that the plugin `cocoapods-patch` be installed. Please install it and try installation again.
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:722:in `block in ensure_plugins_are_installed!'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:720:in `each'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:720:in `ensure_plugins_are_installed!'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:225:in `block in prepare'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:149:in `message'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:222:in `prepare'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:160:in `install!'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/command/install.rb:52:in `run'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:52:in `run'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/bin/pod:55:in `<top (required)>'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/bin/pod:25:in `load'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/bin/pod:25:in `<main>'
[!] use_native_modules! skipped the react-native dependency 'react-native-economist'. No podspec file was found.
- Check to see if there is an updated version that contains the necessary podspec file
- Contact the library maintainers or send them a PR to add a podspec. The react-native-webview podspec is a good example of a package.json driven podspec. See
https://github.com/react-native-community/react-native-webview/blob/master/react-native-webview.podspec
- If necessary, you can disable autolinking for the dependency and link it manually. See
https://github.com/react-native-community/cli/blob/master/docs/autolinking.md#how-can-i-disable-autolinking-for-unsupported-library
I want to add that when I do pod, I'm not getting the patch command, it's like cocoapods-patch wasn't installed at all. But I already did sudo gem install cocoapods-patch many times.
The issue was fixed after following steps:
sudo gem uninstall cocoapods cocoapods-patch
sudo brew uninstall cocoapods cocoapods-patch
sudo brew install cocoapods cocoapods-patch
Basically uninstalling everything and reinstalling with brew. It seems I had installed cocoapods with gem and cocoapods-patch with brew or the other way around.

fatal error: module 'firebase_auth' not found #import firebase_auth

I am trying to use Firebase Authentication for my iOS Flutter.
I have tried all of the procedures laid out in this link but I still receive the same error.
https://github.com/FirebaseExtended/flutterfire/issues/1929
This is the error I receive when I run the iOS app.
/ios/Runner/GeneratedPluginRegistrant.m:10:9: fatal error: module 'firebase_auth' not found
#import firebase_auth;
~~~~~~~^~~~~~~~~~~~~
1 error generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
This is my Podfile
# add pods for desired Firebase products
# https://firebase.google.com/docs/ios/setup#available-pods
# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
target 'Runner' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
pod 'Firebase/Analytics'
pod 'Firebase/Core'
pod 'Firebase/Auth'
pod 'Firebase/Firestore'
pod 'Firebase/Storage'
end
post_install do |pi|
pi.pods_project.targets.each do |t|
t.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
end
end
end
You may be interested in this thread here: https://github.com/FirebaseExtended/flutterfire/issues/192
Essentially its recommendation is to delete Podfile and Podfile.lock. Once you've done this re-run and flutter should automatically create the correct Podfiles for you.
Hopefully that helps.
DB
When it happens remove the "^" on the dependency. So firebase_auth: ^1.0.0 -> firebase_auth: 1.0.0.

Can App Clip be used in an iOS Cocoapods project?

Our App was created in 2018 mid using Swift 4, and other 3rd party depended with Cocoapods.
I add one Clip target, the project structure is different from that given by the download link under session. Run this target, here are the crash errors:
Reason: image not found
dyld: Library not loaded: #rpath/Alamofire.framework/Alamofire
Referenced from: /private/var/containers/Bundle/Application/57185773-B735-4EE5-BB51-790DF004A85B/kt_iOS_Clip.app/kt_iOS_Clip
Reason: image not found
dyld: launch, loading dependent libraries
DYLD_LIBRARY_PATH=/usr/lib/system/introspection
DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/lib/libMainThreadChecker.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib:/Developer/Library/PrivateFrameworks/GPUTools.framework/libglInterpose.dylib:/usr/lib/libMTLCapture.dylib
Here is Podfile:
platform :ios, '10.0'
inhibit_all_warnings!
target '<Main App>' do
use_frameworks!
pod 'SnapKit' , '4.2.0'
pod 'Alamofire' , '4.7.3'
......
target '<Main App>Tests' do
inherit! :search_paths
end
swift_41_pod_targets = ['Spring','PKHUD', 'FSPagerView', 'SQLite.swift','FaveButton']
post_install do | installer |
installer.pods_project.targets.each do |target|
if target.name == 'Cache'
target.build_configurations.each do |config|
level = '-Osize'
config.build_settings['SWIFT_OPTIMIZATION_LEVEL'] = level
puts "Set #{target.name} #{config.name} to Optimization Level #{level}"
end
end
if swift_41_pod_targets.include?(target.name)
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.1'
end
end
end
end
target '<Main App>UITests' do
inherit! :search_paths
end
end
As other answers mentioned, separate app clip target and use_modular_headers! worked for me
platform :ios, '13.0'
target 'MainAppTarget' do
use_frameworks!
pod 'Firebase/Analytics'
pod 'Firebase/RemoteConfig'
target 'MainAppTargetTests' do
inherit! :search_paths
end
end
target 'AppClipTarget' do
use_modular_headers!
pod 'Firebase/Analytics'
target 'AppClipTargetTests' do
inherit! :search_paths
end
target 'AppClipTargetUITests' do
end
end
I fixed this problem by adding another target in my podfile which pointed to the AppClip target
Ref: https://www.natashatherobot.com/cocoapods-installing-same-pod-multiple-targets/
YES, but NO at present (2020.7.15).
igor-makarov had commit an app clip support to master, now just wait for next CocoaPods release.
https://github.com/CocoaPods/CocoaPods/commit/3a5deed0adfa306307027753898cca5e23be14bd
I think the right way to do it is having another target (in my case I placed it outside the main one, because I only want a few pods).
However, Cocoapods needs to update something to export/setup everything right. Since App Clips were introduced recently, Cocoapods hasn't released a new stable version with the fix (https://github.com/CocoaPods/CocoaPods/pull/9882). So we just have to wait a bit, I guess. In the meantime, you can add the Embed Pods Frameworks manually and it will work fine.
Ref: https://developer.apple.com/forums/thread/652683?login=true
What worked for me is doing:
sudo gem install cocoapods --pre
Cocoapods latest stable release at the time of this post was not supporting the app clip target with cocoaPods.

Build issues with Placenote iOS SDK

I have been working on an app which already had integrated Placenote SDK through pods and it was working fine. Sometimes, it gave me build errors but after build clean up it was working fine.
Now, due to certain reasons, I need to update libraries and Placenote also get updated, and now I am facing persistent build failure with following error:
symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Infinite build cleanups but nothing is solving my issue.
Please let me know if someone get me a fix.
### Stack
```
CocoaPods : 1.7.1
Ruby : ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin18]
RubyGems : 2.5.2.3
Host : Mac OS X 10.14.4 (18E226)
Xcode : 10.1 (10B61)
Git : git version 2.17.2 (Apple Git-113)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib
Repositories : master - https://github.com/CocoaPods/Specs.git # 664639fa034e3b1798282006c9c457c8086ffe64
twilio - https://github.com/twilio/cocoapod-specs # 15612163b2cae5be50339701ce3702af12a090f8
```
### Installation Source
```
Executable Path: /usr/local/bin/pod
```
### Plugins
```
cocoapods-deintegrate : 1.0.4
cocoapods-plugins : 1.0.0
cocoapods-search : 1.0.0
cocoapods-stats : 1.0.0
cocoapods-trunk : 1.3.1
cocoapods-try : 1.1.0
```
### Podfile
```ruby
# AppDelegate.swift
# Bryan Cooper
# RocketCM
# The dependency installation file.
platform :ios, '11.0'
target 'RocketCM' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for RocketCM
# Apollo is the GraphQL code generation library.
pod 'Apollo'
# WebSocket provides network layer socket implementation for subscriptions.
pod 'Apollo/WebSocket'
# Crashlytics is a crash monitoring service.
pod 'Crashlytics'
# IQKeyboardManager manages the keyboard sessions to avoid recognizer errors.
pod 'IQKeyboardManagerSwift'
# Fabric is a monitoring solution required for Crashlytics.
pod 'Fabric'
# FSCalendar is a calendar UI library.
pod 'FSCalendar'
# Firebase is the storage solution implementation.
pod 'Firebase/Core'
# Database is the adapter for Firebase Realtime DB NoSQL.
pod 'Firebase/Database'
# Storage is the adapter for Firebase Asset Store.
pod 'Firebase/Storage'
# Placenote is a SLAM implementation to stabilize AR content.
pod 'PlacenoteSDK'
# Google Maps is used to display a map with Google data sourcing.
pod 'GoogleMaps'
# Google Places is used to geocode and reverse geocode location information.
pod 'GooglePlaces'
# ColorPicker is a hue selection UI library.
pod 'SwiftHSVColorPicker'
# WheelPicker is a vertical and horizontal picker library.
pod 'WheelPicker', '~> 1.0'
target 'RocketCMTests' do
inherit! :search_paths
# Pods for testing
end
target 'RocketCMUITests' do
inherit! :search_paths
# Pods for testing
end
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end
```

iOS action extension Cocoapods Podfile FBSDKCoreKit 'sharedApplication' is unavailable

I need the Facebook SDK in both my app and my action extension. I use Cocoapods 1.4.0, Swift 4 and Xcode 9.2. I'm having this error message coming from the FBSDKCoreKit:
'sharedApplication' is unavailable: not available on iOS (App
Extension) - Use view controller based solutions where appropriate
instead.
I've already read a lot of answers, on SOF and Github mainly. I tried a lot of suggestions. But I did not make it work.
My current Podfile:
source 'https://github.com/CocoaPods/Specs.git'
workspace 'MyApp'
use_frameworks!
platform :ios, '10.0'
inhibit_all_warnings!
def my_pods
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'
end
target 'MyApp' do
my_pods
end
target 'MyAppExtension' do
my_pods
end
What I tried:
1) set Require Only App-Extension-Safe API to NO (both for my app and the extension).
2) add this to my podfile:
post_install do |installer_representation|
installer_representation.pods_project.targets.each do |target|
if target.name == "Pods-MyAppExtension-FBSDKCoreKit"
target.build_configurations.each do |config|
//I tried both these lines
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)', 'AF_APP_EXTENSIONS=1']
config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'NO'
end
end
end
end
only as documentation if others arrive here:
using SPM and FB SDK 11.0 AND Xcode 12.x it works
using " " AND Xcode 13.beta for iOS13 fails:
'sharedApplication' is unavailable: not available on iOS (App Extension) - Use view controller based solutions where appropriate instead.
PS
it's a shame using objC in 2021... :(
and ridiculous using "SWFT" Package manager containing objC, :(

Resources