[英]SandboxViolation: WatchOS app crashes when running on device
I have an app for watchOS 3 that works perfectly fine and doesn't really do much.我有一个适用于 watchOS 3 的应用程序,它运行得非常好,但实际上并没有太大作用。 But when I try to launch and debug it on a real device the app crashes and the console logs this:
但是当我尝试在真实设备上启动和调试它时,应用程序崩溃并且控制台会记录以下内容:
SandboxViolation: logd(46) deny(1) file-read-data /private/var/containers/Bundle/Application/*Identifier*/*appname*/Frameworks/libswiftos.dylib
I honestly have no clue what is going wrong.老实说,我不知道出了什么问题。 I remember it to work before but then on one point it stopped (can't remember changing anything relevant)
我记得它以前可以工作,但有一次它停止了(不记得改变任何相关的东西)
通常这是因为您请求了一些需要许可的内容(例如位置、联系人等)并且没有在Info.plist
文件中提供许可原因。
In my case the solution was that the Watch app took too long to launch.就我而言,解决方案是 Watch 应用启动时间过长。 I deleted all upfront initialisation and found out that it was somehow too much (In fact I wasn't doing that much but initialising a picker with images from an extension which took too much time).
我删除了所有的前期初始化并发现它在某种程度上太多了(实际上我并没有做那么多,而是使用扩展中的图像初始化选择器,这花费了太多时间)。
After optimising this it worked as expected!优化后,它按预期工作!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.