Skip to content

Latest commit

 

History

History
57 lines (33 loc) · 3.75 KB

README.md

File metadata and controls

57 lines (33 loc) · 3.75 KB

Update 2018-04-13:

The problem is fixed by Apple. No code changes required when using the latest macOS 10.13.4 (17E199), Xcode 9.3 (9E145) and Swift 4.1 (swiftlang-902.0.48 clang-902.0.37.1).

Screen Savers written in Swift (and compiled with Xcode 9.1) do not work within the System Preferences on macOS High Sierra anymore.

This repository contains a Xcode 9.1 project with 3 simple screen saver targets to demonstrate an issue with Swift and the Screen Saver System Preferences. The project was freshly created with Xcode 9.1 (9B55) for an Apple radar submission.

Targets:

  • QlaasSaverObjc - Pure Objective-C Screen Saver (Text color red)
  • QlaasSaverSwift4 - Swift 4 version (Text color yellow)
  • QlaasSaverSwift32 - Swift 3.2 version (Text color orange)

All of these render a simple text with the current time. Just build them and double click the final product to install (e.g. "QSaverSwift4.saver" in the Finder).

The problem

On macOS Sierra, everything works as expected. On macOS High Sierra though, the loading of the screen saver within the System Preferences fails with:

‼️ THIS IS A DIFFERENT ERROR than a similar one that could be solved by restarting the System Preferences ‼️

System Preferences	Error loading /Users/klaas/Library/Screen Savers/QSaverSwift4.saver/Contents/MacOS/QSaverSwift4: 
dlopen(/Users/klaas/Library/Screen Savers/QSaverSwift4.saver/Contents/MacOS/QSaverSwift4, 265): can't resolve symbol
_OBJC_CLASS_$_NSError in /Users/klaas/Library/Screen Savers/QSaverSwift4.saver/Contents/MacOS/../Frameworks/libswiftCore.dylib
because dependent dylib #1 could not be loaded in /Users/klaas/Library/Screen Savers/QSaverSwift4.saver/Contents/MacOS/../Frameworks/libswiftCore.dylib

Within the Apple screen saver Preview UI this text is displayed: "You cannot use the QSaverSwift4 screen saver with this version of macOS. Please contact the vendor to get a newer version of the screen saver.". This is more or less a generic error that is shown when something does not work.

The screen saver itself still runs fine. But without the possibility to access the settings it is quite unusable.

Related

Current findings and failed solutions

  • My first guess was, that the issue is related to Swift 4. But using Swift 3.2 with Xcode 9.1 does not change anything.
  • The issue is the same regardless of building on Sierra or High Sierra.
  • The issue does not occur on macOS Sierra.

Background

I'm the author of Emoji Saver, that was initially written in Swift 2 in mid 2016 and then later migrated to Swift 3 and 4. Everything worked fine. The problem first occurred on High Sierra (cannot tell which version, but the latest beta 10.13.2 (17C7ca).

Older, released versions that were compiled with Xcode 8.1 still work fine on High Sierra even within the System Preferences: e.g. https://emojisaver.eu/downloads/EmojiSaverLite.zip