ios - Flutter iOS pod未安装
问题描述
我正在尝试在我的颤振项目中安装 alamofire pod 文件,但出现“找不到框架 Alamofire”之类的错误
我在我的 iOS 文件夹中运行 pod install 它给出错误,例如“找不到框架 Alamofire”
我添加了 pod 文件代码
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
'project '
Runner ', {
'Debug' =>: debug,
'Profile' =>: release,
'Release' =>: release,
}
def parse_KV_file(file, separator = '=')
file_abs_path = File.expand_path(file)
if !File.exists ? file_abs_path
return [];
end
pods_ary = []
skip_line_start_symbols = ["#", "/"]
File.foreach(file_abs_path) { | line |
next
if skip_line_start_symbols.any ? { | symbol | line = ~/^\s*#{symbol}/
}
plugin = line.split(pattern = separator)
if plugin.length == 2
podname = plugin[0].strip()
path = plugin[1].strip()
podpath = File.expand_path("#{path}", file_abs_path)
pods_ary.push({: name => podname,
: path => podpath
});
else
puts "Invalid plugin specification: #{line}"
end
}
return pods_ary
end
target 'Runner'
do# use_frameworks!
pod 'Alamofire'#
Prepare
symlinks folder.We use symlinks to avoid having Podfile.lock# referring to absolute paths on developers ' machines.
system('rm -rf .symlinks')
system('mkdir -p .symlinks/plugins')
# Flutter Pods
generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')
if generated_xcode_build_settings.empty ?
puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first."
end
generated_xcode_build_settings.map { | p |
if p[: name] == 'FLUTTER_FRAMEWORK_DIR'
symlink = File.join('.symlinks', 'flutter')
File.symlink(File.dirname(p[: path]), symlink)
pod 'Flutter',: path => File.join(symlink, File.basename(p[: path]))
end
}
#
Plugin Pods
plugin_pods = parse_KV_file('../.flutter-plugins')
plugin_pods.map { | p |
symlink = File.join('.symlinks', 'plugins', p[: name])
File.symlink(p[: path], symlink)
pod p[: name],: path => File.join(symlink, 'ios')
}
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
ld:警告:找不到选项'-F/Users/admin/Library/Developer/Xcode/DerivedData/Runner-cmruivjpakthlvdshvwqbtebetrj/Build/Products/Debug-iphoneos/Alamofire'的目录ld:找不到框架SwiftyJSON clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)
解决方案
推荐阅读
- java - 编写一个程序以显示从 1 到 100 的偶数,用逗号分隔
- spyder - 使用编辑器中的断点和从控制台调用代码来调试 spyder
- html - 标题无响应,导致按钮重叠
- python - 我可以在一行中返回一个索引作为 if 语句吗?
- javascript - MongoDB查询异步循环结果返回空
- php - php 我无法将值附加到 foreach 循环内的数组中
- protocol-buffers - 如何在 .proto 文件中使用 CloudEvent 标准
- python - 如何打印无效消息?
- github - 为什么语言部分没有显示我的 github 存储库?
- mongodb - Mongodb 还包括在匹配运算符中找不到的参数