Cannot import dependency installed using Cocoapods

I installed FBSDK with Cocoapods, but for some reason I can not import it into the AppDelegate.swift file. The FBSDK set appears in my Xcode project, so I feel it should work. enter image description here

I'm not an iOS developer, I'm just trying to write a simple native plugin for the Flutter SDK. Any idea?

- this is what the pod file looks like -

# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'

if ENV['FLUTTER_FRAMEWORK_DIR'] == nil
  abort('Please set FLUTTER_FRAMEWORK_DIR to the directory containing Flutter.framework')
end

target 'Runner' do
  use_frameworks!

  # Pods for Runner
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'

  # Flutter Pods
  pod 'Flutter', :path => ENV['FLUTTER_FRAMEWORK_DIR']

  if File.exists? '../.flutter-plugins'
    flutter_root = File.expand_path('..')
    File.foreach('../.flutter-plugins') { |line|
      plugin = line.split(pattern='=')
      if plugin.length == 2
        name = plugin[0].strip()
        path = plugin[1].strip()
        resolved_path = File.expand_path("#{path}/ios", flutter_root)
        pod name, :path => resolved_path
      else
        puts "Invalid plugin specification: #{line}"
      end
    }
  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

--- EDIT ---

I get the following error the atm: FBSDKCoreKit.framework: No such file or directory. When I open the Frameworks folder in xCode, all the file names are red: But this exact folder in the Finder is empty . So I guess why the error is displayed. The question is how to fix it ...enter image description here

Here are the mine embedded binariesand linked frameworks and librariesin the project: enter image description here

+4
10
  • .
  • .
  • $(SRCROOT)/Pods , Xcode .

enter image description here

+6

, use_frameworks! Podfile. , :

  • Runner-Bridging-Header.h add #import <FBSDKCoreKit/FBSDKCoreKit.h> import FBSDKCoreKit AppDelegate.swift .

  • use_frameworks! Podfile pod install . , , .

+2

Swift?

pod 'FacebookCore'
pod 'FacebookLogin'
pod 'FacebookShare'

, -

import FBSDKLoginKit
import FacebookLogin

(command/⌘ + Shift + K) Build (command/⌘ + B). , .xcworkspace, .

Swift FBSDK .

Swift-, Framework .

enter image description here

, " ", command + Shift + alt + K.

+1

cocoapods, *.xcworkspace. , FBSDK .

0

Command + Shift + K, pods pod.lock .xcworkspace. pod install , .

0

. $() Build.

0

FBSDKCoreKit.framework .. [CP] Embed Pods Frameworks CocoaPods, Embed Frameworks.

CocoaPods , , Facebook, . Facebook Frameworks App-Project (, , , , Pods-Project!), Pods_Runner.framework.

, , Linked Frameworks and Libraries .

, Xcode Facebook CocoaPods. Facebook-SDK AppDelegate , . , , - . , , , xcode- .

Project, , , .

!:)

0

. . podfile, , podfile, podfile, pod install .... ; -)

0

.xcodeproj .xcworkspace? , , cocoapod

0

, . .

0

Source: https://habr.com/ru/post/1680343/


All Articles