在Cocoapod

时间:2019-07-02 16:23:15

标签: swift xcode cocoa dependency-management

使用Swift5和Xcode-10.2。

在安装Cocoapods后,我无法导入Swift模块-为什么?

是的,那里有很多帖子可以为您提供解释。但是到目前为止,他们都没有为我工作。

这是我的pod文件:

project 'M.xcodeproj'
workspace 'MyApp.xcworkspace'
platform :ios, '11.0'
inhibit_all_warnings!

source 'https://github.com/artsy/Specs.git'
source 'https://github.com/CocoaPods/Specs.git'

use_frameworks!

def shared_pods
  pod 'SwiftSVG'
end

target 'MyApp' do
    inherit! :search_paths
    shared_pods
end

t af

1 个答案:

答案 0 :(得分:0)

对不起我!

原来,我的Podfile缺少项目目标:

project 'MyApp.xcodeproj'
workspace 'MyApp.xcworkspace'
platform :ios, '11.0'
inhibit_all_warnings!

source 'https://github.com/artsy/Specs.git'
source 'https://github.com/CocoaPods/Specs.git'

use_frameworks!

def shared_pods
  # pod 'SVGKit'
  pod 'SwiftSVG'
end

target 'MyApp' do
    shared_pods
end

target 'MyApp Beta' do
    shared_pods
end

target 'MyApp Stage' do
    shared_pods
end

target 'MyApp Dev' do
    shared_pods
end

target 'MyApp DevPatch' do
    shared_pods
end

target 'MyApp Test2' do
    shared_pods
end

target 'MyApp TestPatch' do
    shared_pods
end

# target 'MyAppTests' do
#     shared_pods
# end

# target 'MyAppUITests' do
#     shared_pods
# end