我有一个带有Today Extension的iOS应用程序。我们现在正在测试(TestFlight),并在大约十台设备上进行了测试。除了其中一个设备外,关联的Widget显示正常。在一台设备上,Widget显示了可怕的"无法加载"信息。我们已尝试重启设备,删除/重新安装应用等
查看设备日志,我认为这是第一个麻烦的参考:
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。
有什么想法吗?
答案 0 :(得分:3)
我使用(并喜欢)PaintCode,并尽可能地使用其图像代码。一切都是矢量,可以任意大小使用。好东西。无论如何,您可以通过将PaintCode代码分配给拖入Storyboard的Object来在Storyboards中使用PaintCode图像。然后从该对象控制拖动到同一个Storyboard上的UIImageView。在运行时,无论设备分辨率或图像大小如何,都可以完美地绘制图像。
Widget的故事板有三张图片,全部来自PaintCode。三个图像中的一个导致了这个问题。如果我删除了图像,一切都很好。添加它,Widget永远不会启动,并显示&#34;无法加载&#34;。我可以说,图像并不复杂。只是在素描中绘制的矢量图标。
我无法弄清楚为什么那张照片行为不端。我玩过PaintCode设置,导出了几种方式,没有变化。因此,我使用Sketch创建PDF资源,并使用典型的资产目录来处理图像。
通过控制台,即使回想起来,我也看不到任何线索。我猜测,因为Swift代码从未启动过,而且这只是&#34; Plus&#34;大小问题,可能有一个故事板问题。一旦我删除了所有AutoLayout限制一个损坏的Storyboard文件,我的直觉。所以我通过Widget故事板重新创建,并沿途进行测试。当我将PaintCode图像添加回来时它就破了。一旦我有了这个,我就回到原来的故事板,拉出了麻烦的图像,并且Widget显示得很好。
我将修剪项目并将副本发送给PixelCut的优秀人员,以便他们了解情况。如果他们有解决方法,我会在这里发布。
答案 1 :(得分:3)
还有一次会发生这种情况,也就是说,如果在Scheme的目标运行诊断部分下,您已经将Thread Sanitizer / Undefined Behavior Sanitizer打开了。它似乎不喜欢这些选项。