Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dyld: Library not loaded: /usr/lib/swift/libswift_Concurrency.dylib on v0.12.1 for macOS 11.6 #801

Open
ErikBjare opened this issue Sep 28, 2022 · 11 comments

Comments

@ErikBjare
Copy link
Member

ErikBjare commented Sep 28, 2022

The following was posted in: #787 (comment)


Unfortunately, v0.12.1 didn't work for me.
There are no errors in the logs now:

➜  ~ cat ~/Library/Logs/activitywatch/aw-watcher-window/aw-watcher-window_2022-09-28T16-39-12.log 
2022-09-28 16:39:12 [INFO ]: aw-watcher-window started  (aw_watcher_window.main:62)
2022-09-28 16:39:13 [INFO ]: Using swift strategy, calling out to swift binary  (aw_watcher_window.main:67)
2022-09-28 16:39:13 [INFO ]: Connection to aw-server established by aw-watcher-window  (aw_client.client:429)

But it seems that the afk-watcher-window is not running as seen from the ps output

➜  ~ ps aux|grep ActivityWatch|grep -v grep
umar              1424   0.4  0.5  5205432  81832   ??  S     4:38PM   0:04.11 /Applications/ActivityWatch.app/Contents/MacOS/aw-qt
umar              1436   0.3  0.3  4492020  47588   ??  S     4:38PM   0:01.61 /Applications/ActivityWatch.app/Contents/MacOS/aw-watcher-afk
umar              1434   0.0  0.3  4376404  43864   ??  S     4:38PM   0:01.29 /Applications/ActivityWatch.app/Contents/MacOS/aw-server

Running it manually would give the following error:

➜  ~ /Applications/ActivityWatch.app/Contents/MacOS/aw-watcher-window
 2022-09-28 16:44:17 [INFO ]: aw-watcher-window started  (aw_watcher_window.main:62)
usage: A cross platform window watcher for Activitywatch.
Supported on: Linux (X11), macOS and Windows.
       [-h] [--host HOST] [--port PORT] [--testing] [--exclude-title] [--verbose]
       [--poll-time POLL_TIME] [--strategy {jxa,applescript,swift}]
usage: A cross platform window watcher for Activitywatch.
Supported on: Linux (X11), macOS and Windows.
       [-h] [--host HOST] [--port PORT] [--testing] [--exclude-title] [--verbose]
       [--poll-time POLL_TIME] [--strategy {jxa,applescript,swift}]
A cross platform window watcher for Activitywatch.
Supported on: Linux (X11), macOS and Windows.: error: unrecognized arguments: -B -S -E -s -c from multiprocessing.resource_tracker import main;main(5)
A cross platform window watcher for Activitywatch.
Supported on: Linux (X11), macOS and Windows.: error: unrecognized arguments: --multiprocessing-fork tracker_fd=6 pipe_handle=8
2022-09-28 16:44:18 [INFO ]: Using swift strategy, calling out to swift binary  (aw_watcher_window.main:67)
dyld: Library not loaded: /usr/lib/swift/libswift_Concurrency.dylib
  Referenced from: /Applications/ActivityWatch.app/Contents/MacOS/aw_watcher_window/aw-watcher-window-macos
  Reason: image not found
2022-09-28 16:44:19 [INFO ]: Connection to aw-server established by aw-watcher-window  (aw_client.client:429)

Changing the method to jxa also doesn't work with the following logs

Exception: jxa error: Error: Error: An error occurred.
2022-09-28 16:49:36 [ERROR]: Exception thrown while trying to get active window  (aw_watcher_window.main:110)
Traceback (most recent call last):
  File "aw_watcher_window/main.py", line 107, in heartbeat_loop
  File "aw_watcher_window/lib.py", line 55, in get_current_window
  File "aw_watcher_window/lib.py", line 27, in get_current_window_macos
  File "aw_watcher_window/macos_jxa.py", line 64, in getInfo

I'm on macOS Big Sur (v11.6.1)

Any help is appreciated! Thanks :)

Edit: I also get an error pop-up, that I hadn't noticed before, everytime activitywatch opens up. There's no error in the details. But it's consistently crashing

image

Originally posted by @Gleek in #787 (comment)

@ErikBjare
Copy link
Member Author

@modderme123 Any idea how to fix this? :)

@milomg
Copy link

milomg commented Oct 10, 2022

One reason might be because we're somehow building for a newer macos version that doesn't support async networking stuff. We probably need to explicitly set a flag to build for an older version and unfortunately probably also pull in a library to do network requests without modern swift networking (which comes in macos 10.14 I think, so this is probably not why it is failing here)

The other guess I have is also related to building this and that somehow if we don't build with xcode we're building a dev version that requires command line tools and xcode to be installed...

Probably running xcode-select --install will fix it (but isn't an ideal fix)

@Gleek
Copy link

Gleek commented Oct 11, 2022

Probably running xcode-select --install will fix it (but isn't an ideal fix)

This isn't the case for me as I have them installed already.

➜  ~ xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates

@milomg
Copy link

milomg commented Oct 11, 2022

@Gleek Would you mind posting your version of xcode and swift?

@Gleek
Copy link

Gleek commented Oct 11, 2022

@modderme123 Does this help?

➜  ~ xcrun swift -version

Apple Swift version 5.5.2 (swiftlang-1300.0.47.5 clang-1300.0.29.30)
Target: x86_64-apple-darwin20.6.0
➜  ~ pkgutil --pkg-info=com.apple.pkg.CLTools_Executables

package-id: com.apple.pkg.CLTools_Executables
version: 13.2.0.0.1.1638488800
volume: /
location: /
install-time: 1639516865
groups: com.apple.FindSystemFiles.pkg-group 

I don't have the full Xcode installation present. I only have the command line tools installed.

@0xlevel
Copy link

0xlevel commented Jan 29, 2023

I have the same issue as @ErikBjare on macOS Version 11.7.2 with identical Swift and pkgutil versions as @Gleek.
My error message (also the same besides the timestamps):

2023-01-29 13:50:31 [INFO ]: aw-watcher-window started  (aw_watcher_window.main:62)
2023-01-29 13:50:32 [INFO ]: Using swift strategy, calling out to swift binary  (aw_watcher_window.main:67)
2023-01-29 13:50:32 [INFO ]: Connection to aw-server established by aw-watcher-window  (aw_client.client:429)

This also happened using macOS Version 11.7.3.

Switching the strategy_macos in the aw-watcher-window.toml config did not resolve the problem for me → same error.

Also, I was unable to build from source with macOS 11 (as expected, since macOS 12.0 seems to be required):

Installing the current project: aw-watcher-window (0.2.0)
# if macOS, build swift
if [ "Darwin" = "Darwin" ]; then \
		make build-swift; \
	fi
swiftc aw_watcher_window/macos.swift -o aw_watcher_window/aw-watcher-window-macos
aw_watcher_window/macos.swift:189:53: error: 'upload(for:from:delegate:)' is only available in macOS 12.0 or newer
    let (_, response) = try await URLSession.shared.upload(for: urlRequest, from: payload)

I intent to stay on macOS 11 for the weeks to come. If I can help out by running any possibly fixed versions on my system, please let me know.

@BelKed
Copy link
Contributor

BelKed commented Jul 26, 2023

Looks like there's a solution described in this blog post:
https://nonstrict.eu/blog/2023/using-async-await-in-a-commandline-tool-on-older-macos-versions

Unfortunately, I wasn't able to make the changes to the aw-watcher-window package to confirm this :(

@schackbrian2012
Copy link

schackbrian2012 commented Aug 6, 2023

@BelKed You referred me to this issue from "Module aw-watcher-window quit unexpectedly." I am using macOS BigSur 11.2.3. If I understand correctly, then ActivityWatch is not compatible with this version of macOS. If I upgrade to the latest version of macOS, then will that solve the issue?

@BelKed
Copy link
Contributor

BelKed commented Aug 6, 2023

Yes, upgrading to macOS Monterey will solve the problem :)
(I can confirm this because I'm running ActivityWatch on macOS Monterey without any issues)

@schackbrian2012
Copy link

@BelKed Okay, I will back up and upgrade macOS.

@schackbrian2012
Copy link

@BelKed Good news! I upgraded to macOS Ventura 13.4.1, and ActivityWatch is tracking time again. Thank you for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants