如何避免Mojave上的Safari扩展崩溃?

时间:2018-08-02 15:41:42

标签: swift safari-extension macos-mojave

构建包含Safari扩展程序的macOS应用程序(在Safari上运行)时,运行了几秒钟后它便崩溃了(尽管确实显示在扩展程序中)。

Safari试图从本地Library文件夹中获取数据似乎是一个问题。它似乎也在Info.plist上挣扎

这是崩溃日志:

2018-08-02 17:33:47.464379+0200 Safari[14693:1179568] [default] Unable to load Info.plist exceptions (eGPUOverrides)
2018-08-02 17:33:47.487993+0200 Safari[14693:1179565] [SQLiteStore] Failed to acquire database store coordination lock at /Users/lukasmuller/Library/Safari/Favicon Cache/favicons.db-lock: [35: Resource temporarily unavailable]
2018-08-02 17:33:47.488150+0200 Safari[14693:1179565] [SQLiteStore] Failed to acquire exclusive access to database at file:///Users/lukasmuller/Library/Safari/Favicon%20Cache/favicons.db.
2018-08-02 17:33:47.488580+0200 Safari[14693:1179565] [SQLiteStore] Failed to acquire database store coordination lock at /Users/lukasmuller/Library/Safari/Favicon Cache/favicons.db-lock: [35: Resource temporarily unavailable]
2018-08-02 17:33:47.488615+0200 Safari[14693:1179565] [SQLiteStore] Failed to acquire exclusive access to database at file:///Users/lukasmuller/Library/Safari/Favicon%20Cache/favicons.db.
2018-08-02 17:33:47.488694+0200 Safari[14693:1179565] [SQLiteStore] Falling back to an in-memory store
2018-08-02 17:33:47.489617+0200 Safari[14693:1179565] [FaviconPersistence] Using in-memory representation for database /Users/lukasmuller/Library/Safari/Favicon Cache/favicons.db
2018-08-02 17:33:47.505346+0200 Safari[14693:1179572] [SQLiteStore] Failed to acquire database store coordination lock at /Users/lukasmuller/Library/Containers/com.apple.Safari/Data/Library/Caches/com.apple.Safari/TabSnapshots/Metadata.db-lock: [35: Resource temporarily unavailable]
2018-08-02 17:33:47.505870+0200 Safari[14693:1179572] [SQLiteStore] Failed to acquire exclusive access to database at file:///Users/lukasmuller/Library/Containers/com.apple.Safari/Data/Library/Caches/com.apple.Safari/TabSnapshots/Metadata.db.
2018-08-02 17:33:47.572816+0200 Safari[14693:1179583] flock failed to lock maps file: errno = 35
2018-08-02 17:33:47.573799+0200 Safari[14693:1179583] flock failed to lock maps file: errno = 35
2018-08-02 17:33:47.604115+0200 Safari[14693:1179588] Failed to acquire exclusive access to AutoFill corrections SQLite store at AutoFillCorrections.db.
Failed to acquire exclusive access to AutoFill corrections SQLite store at AutoFillCorrections.db.
2018-08-02 17:33:47.607520+0200 Safari[14693:1179588] Failed to acquire exclusive access to AutoFill corrections SQLite store at CloudAutoFillCorrections.db.
Failed to acquire exclusive access to AutoFill corrections SQLite store at CloudAutoFillCorrections.db.
2018-08-02 17:33:47.608239+0200 Safari[14693:1179588] Failed to acquire exclusive access to AutoFill corrections SQLite store at AutoFillCorrections.db.
Failed to acquire exclusive access to AutoFill corrections SQLite store at AutoFillCorrections.db.
2018-08-02 17:33:47.609424+0200 Safari[14693:1179588] Failed to acquire exclusive access to AutoFill corrections SQLite store at CloudAutoFillCorrections.db.
Failed to acquire exclusive access to AutoFill corrections SQLite store at CloudAutoFillCorrections.db.
2018-08-02 17:33:47.857619+0200 Safari[14693:1179579] Failed to acquire exclusive access to AutoFill corrections SQLite store at AutoFillCorrections.db.
Failed to acquire exclusive access to AutoFill corrections SQLite store at AutoFillCorrections.db.
2018-08-02 17:33:47.859043+0200 Safari[14693:1179565] [CrowdsourcedAutoFill] Unable to read cloud AutoFill correction sets, error: Error Domain=NSCocoaErrorDomain Code=260 "The file couldn’t be opened because it doesn’t exist."
2018-08-02 17:33:47.859839+0200 Safari[14693:1179579] Failed to acquire exclusive access to AutoFill corrections SQLite store at CloudAutoFillCorrections.db.
Failed to acquire exclusive access to AutoFill corrections SQLite store at CloudAutoFillCorrections.db.
2018-08-02 17:33:47.871122+0200 Safari[14693:1179640] [CloudBookmarks] Error fetching remote migration state: Error Domain=com.apple.SafariBookmarksSync.CloudBookmarksErrorDomain Code=0 "(null)"
2018-08-02 17:33:47.953061+0200 Safari[14693:1179640] [RemotePlistController] The downloaded plist could not be loaded: Error Domain=NSCocoaErrorDomain Code=260 "The file couldn’t be opened because it doesn’t exist."
2018-08-02 17:33:48.191583+0200 Safari[14693:1179568] [trace] RWIMobileDeviceConnection (Direct): Unable to start a session: The host is not paired with the device.
2018-08-02 17:33:48.202902+0200 Safari[14693:1179568] [trace] RWIMobileDeviceConnection (Direct): Unable to stop session: The session is inactive.
2018-08-02 17:33:48.234006+0200 Safari[14693:1179572] Failed to acquire exclusive access to AutoFill corrections SQLite store at AutoFillCorrections.db.
Failed to acquire exclusive access to AutoFill corrections SQLite store at AutoFillCorrections.db.
2018-08-02 17:33:48.235327+0200 Safari[14693:1179572] Failed to acquire exclusive access to AutoFill corrections SQLite store at CloudAutoFillCorrections.db.
Failed to acquire exclusive access to AutoFill corrections SQLite store at CloudAutoFillCorrections.db.
2018-08-02 17:33:52.195337+0200 Hockey Crahses to Jira[14702:1180067] [default] Unable to load Info.plist exceptions (eGPUOverrides)
2018-08-02 17:30:28.465503+0200 Hockey Crashes to Jira[14575:1165922] [default] Unable to load Info.plist exceptions (eGPUOverrides)
2018-08-02 17:30:43.565677+0200 Hockey Crashes to Jira[14575:1165922] [default] Unable to load Info.plist exceptions (eGPUOverrides)

有没有人遇到过类似的问题并找到了解决问题的方法?

3 个答案:

答案 0 :(得分:4)

我有同样的(随机)问题。 清理项目(产品/清洁)和构建文件夹(产品/清洁菜单上的Alt)后,问题似乎消失了

但是消息“ [默认]无法加载Info.plist异常(eGPUOverrides)”仍然存在... 由于一切正常,它似乎并不宽容。

我已经为Safari App Extensions开发人员创建了一个Slack社区,欢迎您加入我们:https://slofile.com/slack/safariappextdevs

答案 1 :(得分:0)

基本上,您正在尝试在设备上运行它。例如,如果您希望在iOS设备上运行iOS应用,则需要配置配置文件。同样,如果您希望在macOS设备上运行macOS应用程序,则必须为其设置配置文件。

  • 选择“项目”,选择主要目标,确保已设置配置文件,团队。
  • 还可以设置safari扩展目标的配置文件。
  • 设置完成后,运行safari扩展程序。
  • 转到safari偏好设置,“扩展程序”标签并启用您的扩展程序。

希望有帮助。干杯。

答案 2 :(得分:0)

所以,显然:

如果在一定时间内未找到交互/消息,则Xcode调试器将终止浏览器。

因此,要避免这种情况,您要做的就是在注入的脚本中编写该代码:

setInterval(() => safari.extension.dispatchMessage("ping", {}), 1000);

I wrote this article that explains the common problems encountered while developing Safari App Extensions