Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Swift4 Error on High Sierra, can't resolve symbol

I've got this prefpane made in Swift and Cocoa... Yesterday I migrated it to Swift 4 as-per-the-migration guide and after some initial pains everything appeared to be working perfectly.

I did this on Sierra, running Xcode 9.0 with the latest SDK.

Problem is, at least two people running High Sierra tell me the pane is not running at all for them. From attempting to run it from the command line, this is the reported error:

2017-09-27 23:00:59.921 System Preferences[3047:337095] Error loading /Users/luckman212/Library/PreferencePanes/SwiftDefaultApps.prefPane/Contents/MacOS/SwiftDefaultApps:  dlopen(/Users/luckman212/Library/PreferencePanes/SwiftDefaultApps.prefPane/Contents/MacOS/SwiftDefaultApps, 265): can't resolve symbol _OBJC_CLASS_$_NSError in /Users/luckman212/Library/PreferencePanes/SwiftDefaultApps.prefPane/Contents/MacOS/../Frameworks/libswiftCore.dylib because dependent dylib #1 could not be loaded in /Users/luckman212/Library/PreferencePanes/SwiftDefaultApps.prefPane/Contents/MacOS/../Frameworks/libswiftCore.dylib
2017-09-27 23:00:59.922 System Preferences[3047:337095] [NSPrefPaneBundle instantiatePrefPaneObject] (/Users/luckman212/Library/PreferencePanes/SwiftDefaultApps.prefPane): principalClass is nil.
2017-09-27 23:01:00.072 System Preferences[3047:337095]  ### AE 1868656752 sender's PID is 3047 (System Preferences)

I haven't upgraded yet and have no way to do it at present, even if I was so-inclined. Haas anybody faced this issue, and/or know the cause for it?

like image 447
Gregorio Litenstein Avatar asked Sep 28 '17 04:09

Gregorio Litenstein


1 Answers

Some code angel at Apple fixed the specific issue in one of the latest dot releases of macOS High Sierra! Yay!

I'm on the latest macOS 10.13.4 (17E199), Xcode 9.3 (9E145) and Swift 4.1 (swiftlang-902.0.48 clang-902.0.37.1).

My simple test project https://github.com/klaas/QlaasSwiftScreenSaver, the famous Aerial saver https://github.com/JohnCoates/Aerial/pull/420‌ and my Emoji Saver https://emojisaver.eu‌ work again!

The issues described by Quinn at https://forums.developer.apple.com/message/268934 still exist in general, but at least with only one (used) Swift plugin/saver within the System Preferences everything is fine.

like image 197
Klaas Avatar answered Nov 13 '22 13:11

Klaas