我有一个带有 Today Extension 的 iOS 应用程序。我们现在正在测试(TestFlight),并且已经在大约十台设备上进行了测试。关联的小部件在除其中一台设备之外的所有设备上都可以正常显示。在一台设备上,小部件会显示可怕的“无法加载”消息。我们尝试过重启设备、删除/重新安装应用程序等。
查看设备日志,我看到这是第一个麻烦的参考:
container: WGMajorListViewController> Unable to load widget view controller with service (com.mycompany.MyApp.myApp-Today-Extension): Couldn\M-b\M^@\M^Yt communicate with a helper application.
container: WGMajorListViewController> No longer waiting on connection semaphore (<OS_dispatch_semaphore: 0x174c85410>)
container: WGMajorListViewController> Severed remote view controller connection
container: WGMajorListViewController> Widget disconnected unexpectedly
container: WGMajorListViewController> Aborting active life cycle sequence: <WGWidgetLifeCycleSequence: 0x175035460; sequenceID: com.mycompany.MyApp.myApp-Today-Extension.WGMajorListViewController.7/11/17, 3:13:00 PM; currentState: WGWidgetLifeCycleSequenceStateDidRequestRemoteView>
container: WGMajorListViewController> Remote view controller disconnected unexpectedly
container: WGMajorListViewController> Attempting to reconnect to remote view controller
扩展程序的代码没有尝试打开主机应用程序,所以这个错误让我很困惑。也许这指的是内部(iOS)帮助应用程序?
第一行中的奇数转义字符在日志中。在这些行之后,它再次尝试,可能再试两次,然后失败。最终我看到Can't request remote view controller that is blacklisted
并且设备在重新启动之前不会重试:
mediaserverd(CoreMedia)[27] <Notice>: -CMSessionMgr- cmsmHandleApplicationStateChange: CMSession: Client com.mycompany.MyApp.myApp-Today-Extension with pid '257' is now Terminated. Background entitlement: NO
mediaserverd(CoreMedia)[27] <Notice>: -CMSessionMgr- cmsmHandleApplicationStateChange: CMSession: Client com.mycompany.MyApp.myApp-Today-Extension with pid '259' is now Terminated. Background entitlement: NO
symptomsd(SymptomEvaluator)[121] <Notice>: 257 com.mycompany.MyApp.myApp-Today-Extension: Terminated (most elevated: Terminated)
symptomsd(SymptomEvaluator)[121] <Notice>: 259 com.mycompany.MyApp.myApp-Today-Extension: Terminated (most elevated: Terminated)
symptomsd(SymptomEvaluator)[121] <Notice>: Entry, display name com.mycompany.MyApp.myApp-Today-Extension uuid (null) pid 257 isFront 0
symptomsd(SymptomEvaluator)[121] <Notice>: Duplicate removal of display name com.mycompany.MyApp.myApp-Today-Extension
symptomsd(SymptomEvaluator)[121] <Notice>: Entry, display name com.mycompany.MyApp.myApp-Today-Extension uuid (null) pid 259 isFront 0
symptomsd(SymptomEvaluator)[121] <Notice>: Duplicate removal of display name com.mycompany.MyApp.myApp-Today-Extension
container: WGMajorListViewController> End sequence '(null)' with reason: disappearance transition
container: WGMajorListViewController> Can't end sequence as argument sequence ((null)) doesn't match active sequence ((null)), or there's no active sequence
container: WGMajorListViewController> Begin sequence with reason: appearance transition
container: WGMajorListViewController> Initiating new life cycle sequence: '<WGWidgetLifeCycleSequence: 0x17522b6e0; sequenceID: com.mycompany.MyApp.myApp-Today-Extension.WGMajorListViewController.7/11/17, 3:13:12 PM; currentState: WGWidgetLifeCycleSequenceStateQuiescent>'
container: WGMajorListViewController> Connection requested with reason: 'appearance transition'
container: WGMajorListViewController> Will request remote view controller
container: WGMajorListViewController> Can't request remote view controller that is blacklisted
我没有看到扩展代码本身的任何日志记录,也没有任何迹象表明它实际上正在启动。
有问题的设备是 iPhone 7 Plus,运行 iOS 10.3.2 的公共版本。该小部件在所有其他设备上运行良好,其中许多设备也是 10.3.2。其他都不是 iPhone 7 Plus。该小部件在 iPhone 7 Plus 模拟器中运行良好。
同一台设备可以正常运行 App Store 版本的小部件,尽管该版本是针对 iOS 9 和 Xcode 7 构建的。新版本使用 10.3 作为其基本 SDK,使用 Xcode 8.3.3。
有什么想法吗?