项目做开发一个视频播放的功能,资源是flv格式,系统原生的player是不支持的,所以第一选择就是常见到的ijkplayer了,然后在git上找到一个很强大的第三方播放器SJVideoPlayer,它可以随意 切换到第三方SDK,我的项目用得到的是ijkplayer
SJVideoPlayer 的地址 :github.com/changsanjia…
pod项目
# 如果网络不行安装不了, 可改成以下方式进行安装
pod 'SJBaseVideoPlayer', :git => 'https://gitee.com/changsanjiang/SJBaseVideoPlayer.git'
pod 'SJVideoPlayer', :git => 'https://gitee.com/changsanjiang/SJVideoPlayer.git'
$ pod update --no-repo-update (不要用 pod install 了, 用这个命令安装)
切换三方SDK ijkplayer 需要重新pod
source 'https://cdn.cocoapods.org/'
pod 'SJBaseVideoPlayer/IJKPlayer'
pod 'ijkplayerssl', :git => 'https://gitee.com/changsanjiang/ijkplayer.git'
pod 'SJVideoPlayer'
调整pod:
1.如果 podfile中包含了 use_frameworks! 需要更新 cocoapods
gem install cocoapods
2.然后把podfile中的 use_frameworks! 改为 use_frameworks! :linkage => :static
调整项目配置 :
1.targets->build setting ->搜索 architectures
只需要 arm64 arm64e,(我的项目还有 armv7s armv7 ,连接usb线真机调试可以运行,但是打包就不行了,出行很多红色报错)
2.targets->build setting ->搜索 bitcode,设置bitcode为NO
如果真机调试正常,但是打包却出现这样的情况
回到第一步 targets->build setting ->搜索 architectures
只需要 arm64 arm64e
最近更新了xcode 版本是12.2,使用ijkpayer的工程在同事上报错,xcode 12 中 targets->build setting 搜索 architectures ,而这个architectures 中的Valid Architectures 找不到,反而多了一个Excluded Architectures
同事的xcode architectures 配置如下图是编译不了的
我的xcode architectures 是可以编译的 ,在Excluded Architectures 什么都没有设置
更新 Xcode 工程架构列表
Xcode 12及更高版本会自动将 arm64 架构添加到所有 macOS 二进制文件(包括应用程序和库)的标准架构列表中。在调试和测试过程中,在默认情况下,Xcode 仅针对当前系统架构构建版本,但是,它会为代码的 Release 版本自动构建通用二进制文件。
如果在工程中自定义了 Architectures 构建设置,删除自定义项并改用 Standard Architectures 设置。