我正在使用快速通道打包我的应用程序,我在我的应用程序中写了一些支持iOS13的类,比如UIStatusBarManager类,然后它打包失败了,我该怎么办?
我已经将快速通道更新到最新版本,但xcode仍然是xcode10。
以下是我使用fastlane打包时得到的错误:
[11:04:05]: ▸ ❌ /Users/wanghq/jenkins_workspaces/workspace/mobile-ios-teacher-ipa/Teacher_iOS/Train/Record/Utils/ZFPlayer/ZFPlayerView.m:909:9: use of undeclared identifier 'UIStatusBarManager'
[11:04:05]: ▸ UIStatusBarManager *statusBarManager = [UIApplication sharedApplication].keyWindow.windowScene.statusBarManager;
[11:04:05]: ▸ ^
[11:04:05]: ▸ ❌ /Users/wanghq/jenkins_workspaces/workspace/mobile-ios-teacher-ipa/Teacher_iOS/Train/Record/Utils/ZFPlayer/ZFPlayerView.m:909:29: use of undeclared identifier 'statusBarManager'
[11:04:05]: ▸ UIStatusBarManager *statusBarManager = [UIApplication sharedApplication].keyWindow.windowScene.statusBarManager;
[11:04:05]: ▸ ^
[11:04:05]: ▸ ❌ /Users/wanghq/jenkins_workspaces/workspace/mobile-ios-teacher-ipa/Teacher_iOS/Train/Record/Utils/ZFPlayer/ZFPlayerView.m:909:92: property 'windowScene' not found on object of type 'UIWindow *'
[11:04:05]: ▸ UIStatusBarManager *statusBarManager = [UIApplication sharedApplication].keyWindow.windowScene.statusBarManager;
[11:04:05]: ▸ ^
[11:04:05]: ▸ ❌ /Users/wanghq/jenkins_workspaces/workspace/mobile-ios-teacher-ipa/Teacher_iOS/Train/Record/Utils/ZFPlayer/ZFPlayerView.m:910:14: use of undeclared identifier 'statusBarManager'
[11:04:05]: ▸ if ([statusBarManager respondsToSelector:@selector(createLocalStatusBar)]) {
[11:04:05]: ▸ ^
[11:04:05]: ▸ ** ARCHIVE FAILED **
[11:04:05]: ▸ The following build commands failed:
[11:04:05]: ▸ CompileC /Users/wanghq/Library/Developer/Xcode/DerivedData/Teacher_iOS-faqbabrkmkezsveufzeljjrkqytg/Build/Intermediates.noindex/ArchiveIntermediates/Teacher_iOS/IntermediateBuildFilesPath/Teacher_iOS.build/Debug-iphoneos/Teacher_iOS.build/Objects-normal/armv7/ZFPlayerView.o /Users/wanghq/jenkins_workspaces/workspace/mobile-ios-teacher-ipa/Teacher_iOS/Train/Record/Utils/ZFPlayer/ZFPlayerView.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
[11:04:05]: ▸ (1 failure)
[11:04:05]: ▸ ❌ /Users/wanghq/jenkins_workspaces/workspace/mobile-ios-teacher-ipa/Teacher_iOS/Train/Record/Utils/ZFPlayer/ZFPlayerView.m:911:40: use of undeclared identifier 'statusBarManager'这是构建环境:
+---------------+-------------------------+
| Build environment |
+---------------+-------------------------+
| xcode_path | /Applications/Xcode.app |
| gym_version | 2.134.0 |
| export_method | development |
| sdk | iPhoneOS12.2.sdk |
+---------------+-------------------------+请帮帮我,谢谢!
发布于 2019-10-18 11:55:47
要使用iOS 13SDK,您需要Xcode11或更高版本。
Fastlane不能做底层构建系统不能做的任何事情。由于您调用的是iOS 12.2SDK中不存在的UIStatusBarManager等API的一部分,因此编译器不知道如何处理这些错误。
更新Xcode并瞄准iOS 13 (或13.1) SDK。
发布于 2019-10-27 13:39:12
然后,您可以对有问题的代码节使用“编译器条件指令”。
例如,我有XCode 10.3,我可以用下面的修改来编译项目。

https://stackoverflow.com/questions/58443638
复制相似问题