今天,在iOS 8.1.2上启动之前,Extension崩溃了 [英] Today Extension Crashes before launching on iOS 8.1.2

查看:139
本文介绍了今天,在iOS 8.1.2上启动之前,Extension崩溃了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在制作今天的扩展程序,从Feed中下载文章并显示最新的文章。
完整的东西在iOS 8上运行良好,仍在iOS 8.1上运行,然后是iOS 8.1.2,我们开始抱怨今天的扩展程序不再起作用了。
我尝试在iOS 8.1.2设备上进行调试,在扩展甚至启动之前,它崩溃了这个错误:

I've been making a today extension that downloads articles from a feed and display the latest ones. The whole thing worked fine on iOS 8, still worked on iOS 8.1, then came iOS 8.1.2 and we started having complaints about the today extension not working anymore. I tried debugging on iOS 8.1.2 devices, and before the extension even launch, it crashes with this error :

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** setObjectForKey: object cannot be nil (key: <__NSConcreteUUID 0x174027280> 5AFB07AB-5DCD-46FE-8D07-44DE0F3789F2)'

我已经阅读了这篇关于开发今天扩展时发生频繁错误的帖子:http://www.atomicbird.com/blog/ios-app-extension-tip

I have read this post about frequent bugs happening when developing a today extension : http://www.atomicbird.com/blog/ios-app-extension-tip

在他的帖子中,Tom Harrington说:

In his post, Tom Harrington says :


在iOS 8(以及其他最新版本)中,在Xcode的构建设置中启用模块意味着你不要需要明确列出您要使用的所有框架。它们将被自动找到。

In iOS 8 (and other recent versions), enabling modules in Xcode's build settings means you don't need to explicitly list all the frameworks you want to use. They'll be found automatically.

但是今天扩展使用的NotificationCenter.framework不是这种情况。如果从构建设置中删除它,则不会收到任何构建警告或错误。但是当您尝试加载扩展时,您将从libextension.dylib获得一个异常,并且您的扩展将不会加载。异常消息没有启发性:

But this isn't the case with NotificationCenter.framework, which Today extensions use. If you remove that from the build settings, you won't get any build warnings or errors. But when you try to load the extension, you'll get an exception from libextension.dylib and your extension won't load. The exception message is not enlightening:

2014-08-16 12:06:53.793 TodayTestExtension [41313:6111763] *终止
app由于未捕获的异常'NSInvalidArgumentException',原因:'*

setObjectForKey:object不能为nil(key:< __ NSConcreteUUID
0x7fd729422390> ED3B42F8-66CD-4CB0-BCD5-F3DBA​​6F34DB5)'
如果您正在进行今天的扩展,只需将该框架保留在构建设置中即可。它不应该在那里,但它确实存在。

2014-08-16 12:06:53.793 TodayTestExtension[41313:6111763] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* setObjectForKey: object cannot be nil (key: <__NSConcreteUUID 0x7fd729422390> ED3B42F8-66CD-4CB0-BCD5-F3DBA6F34DB5)' If you're doing a today extension, just leave that framework in the build settings. It shouldn't need to be there, but it does.

我的扩展在其构建设置中包含NotificationCenter.framework,但是我怀疑我的问题可能在某种程度上相似。

My extension does include NotificationCenter.framework in its build settings, but I suspect my problem might be similar in some way.

任何人遇到类似的问题?知道怎么解决吗?

Anyone faced a similar problem? Any idea how to solve it?

推荐答案

最后我试图从我的目标中删除NotificationCenter.framework并将其放回去,清理项目,它现在再次工作。我想框架毕竟没有正确链接,虽然我可以在xcode的目标上看到它。另外,我无法弄清楚它为什么会起作用,然后停止使用8.1.2的到来。

Eventually I tried to remove NotificationCenter.framework from my target and put it back, cleaned the project, and it's now working again. I guess the framework wasn't properly linked after all, though I could see it on my target with xcode. Also, I can't figure out why it did work, then stopped working with the arrival of 8.1.2.

这篇关于今天,在iOS 8.1.2上启动之前,Extension崩溃了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆