简体   繁体   English

SandboxViolation:WatchOS 应用在设备上运行时崩溃

[英]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.

相关问题 运行设备的 watchOS 应用程序时出现“IDELaunchErrorDomain”错误 - “IDELaunchErrorDomain” error while running watchOS app of device 应用程序在设备上调试时崩溃 - App Crashes when debugging on device 当应用程序在设备上的 Xcode 中运行时,MKMapView 使应用程序崩溃,但如果通过应用程序图标点击在设备上运行则不会 - MKMapView crashes the app when app is run in Xcode on a device but not if running on device by application icon tap 当watchOS应用程序使用HKWorkoutSession在后台运行时如何使WCSession可访问 - How to make WCSession reachable when the watchOS app is running in background with HKWorkoutSession 当我的设备上运行其他应用程序(2个或更多应用程序)时,ImagePickerController使我的应用程序崩溃,并显示“ Received Memory Warning” - ImagePickerController crashes my app saying “Received Memory Warning” when there are other apps running on my device (2 or more apps) 在iPhone上运行时,应用程序崩溃,例外情况 - App crashes when running on iPhone with violations as exception Alamofire仅在运行存档的应用程序时崩溃 - Alamofire crashes only when running archived app 在模拟器(而非设备)上调试AppleWatch应用时,iOS应用立即崩溃 - iOS app crashes immediately when debugging AppleWatch app on Simulator (not on device) 提交 iOS 应用程序时 watchOS 应用程序出现问题 - Issue with watchOS app when submit iOS app 无法在watchOS模拟器Xcode9,iOS11上安装应用,watchOS4应用崩溃 - Unable to install app on watchOS simulator Xcode9, iOS11, watchOS4 app crashes
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM