我有一个库,它在同一个工作区中有tvOS和iOS的目标。
当我为tvOS构建时,它给我一个错误,说:
The following build commands failed:
CompileSwift normal arm64
CompileXIB /Users/.../<project_folder>/Pods/Clappr/Sources/Clappr_iOS/Classes/Plugin/Core/MediaControl/Seekbar/Views/SeekbarView.xib
CompileSwift normal arm64快速通道用来运行构建的命令是:set -o pipefail && xcodebuild -workspace "<project_name>.xcworkspace" -scheme "<scheme_name>_tvOS" -configuration "Release" -sdk "appletvos" -derivedDataPath "build/tvOS-appletvos" clean build GCC_PREPROCESSOR_DEFINITIONS='${inherited}' BITCODE_GENERATION_MODE=bitcode ENABLE_BITCODE=YES
当我在verbose模式下运行它时,似乎显示错误的部分是:
CompileXIB /Users/<project_folder>/Pods/Clappr/Sources/Clappr_iOS/Classes/Plugin/Core/MediaControl/Seekbar/Views/SeekbarView.xib (in target: Clappr-iOS)
cd /Users/<project_folder>/Pods
export XCODE_DEVELOPER_USR_PATH=/Applications/Xcode.app/Contents/Developer/usr/bin/..
/Applications/Xcode.app/Contents/Developer/usr/bin/ibtool --errors --warnings --notices --module Clappr --output-partial-info-plist /Users/<project_folder>/build/tvOS-appletvos/Build/Intermediates.noindex/Pods.build/Release-appletvos/Clappr-iOS.build/SeekbarView-PartialInfo.plist --auto-activate-custom-fonts --target-device tv --minimum-deployment-target 10.0 --output-format human-readable-text --compile /Users/<project_folder>/build/tvOS-appletvos/Build/Products/Release-appletvos/Clappr-iOS/Clappr.framework/SeekbarView.nib /Users/<project_folder>/Pods/Clappr/Sources/Clappr_iOS/Classes/Plugin/Core/MediaControl/Seekbar/Views/SeekbarView.xib
/* com.apple.ibtool.errors */
/Users/<project_folder>/Pods/Clappr/Sources/Clappr_iOS/Classes/Plugin/Core/MediaControl/Seekbar/Views/SeekbarView.xib: error: iOS xibs do not support target device type "tv".它正在选择一个依赖项(Clappr)不属于tvOS目标的xib。
此外,当我尝试使用iOS目标进行构建时,它会回答我以下问题:
The following build commands failed:
CompileSwift normal armv7
CompileSwiftSources normal armv7 com.apple.xcode.tools.swift.compiler
CompileSwift normal arm64
CompileSwift normal armv7
CompileSwift normal arm64用于运行tvOS构建的快速通道如下所示:
private_lane :xc_build do |params|
xcodebuild(
workspace: "ProjectName.xcworkspace",
scheme: params[:scheme],
configuration: 'Release',
sdk: params[:sdk],
derivedDataPath: params[:derivedDataPath],
clean: true,
build: true,
xcargs: params[:xcargs]
)
end
lane :build_tvos do
remove_previous_builds_of(platform: "tvOS")
#It breaks on the following command
xc_build(
scheme: 'ProjectScheme_tvOS',
sdk: 'appletvos',
derivedDataPath: 'build/tvOS-appletvos',
xcargs: "GCC_PREPROCESSOR_DEFINITIONS='${inherited}' BITCODE_GENERATION_MODE=bitcode ENABLE_BITCODE=YES"
)
xc_build(
scheme: 'ProjectScheme_tvOS',
sdk: 'appletvsimulator',
derivedDataPath: 'build/tvOS-appletvsimulator',
xcargs: "GCC_PREPROCESSOR_DEFINITIONS='${inherited}' BITCODE_GENERATION_MODE=bitcode ENABLE_BITCODE=YES"
)
#This uses lipo to build universal frameworks
make_universal_framework(
universal_framework_folder: "Framework/tvOS",
device_framework_folder: "build/tvOS-appletvos/Build/Products/Release-appletvos",
simulator_framework_folder: "build/tvOS-appletvsimulator/Build/Products/Release-appletvsimulator"
)
end环境信息:
* iOS目标的build seating valid architectures的值为arm64 arm64e armv7 armv7s,tvOS的值为:arm64
* Fastlane版本2.123.0
* Cocoapods版本1.6.1
* make_universal_framework使用lipo构建
发布于 2019-05-29 21:13:18
老实说,我不知道为什么它会失败,尽管我找到了一个解决方案。
这个答案让我找到了正确的方向:https://github.com/Webtrekk/webtrekk-ios-sdk/issues/55#issuecomment-481720922
我知道,我的问题与写在GitHub问题上的问题无关,但它给了我一个解决它的想法。我去了菜单
文件->项目(工作区)设置->工作区设置->生成系统=>‘旧版生成系统’
它解决了这个问题!
这似乎在构建系统上有所不同,但我还没有找到证实这一点的文档。
https://stackoverflow.com/questions/56330084
复制相似问题