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

Cannot build app #2797

Closed
jefflongo opened this issue Mar 17, 2025 · 3 comments
Closed

Cannot build app #2797

jefflongo opened this issue Mar 17, 2025 · 3 comments

Comments

@jefflongo
Copy link

jefflongo commented Mar 17, 2025

Platform

Flutter Desktop Linux

Obfuscation

Disabled

Debug Info

Disabled

Doctor

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.29.2, on Ubuntu 24.04.2 LTS 6.8.0-55-generic, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Linux toolchain - develop for Linux desktop
[✓] Android Studio (version 2024.1)
[✓] VS Code (version 1.98.1)
[✓] Connected device (1 available)
[✓] Network resources

Version

8.14.0

Steps to Reproduce

  1. Add sentry in project
  2. flutter run

Expected Result

Expected app to run

Actual Result

$ flutter run
Launching lib/main.dart on Linux in debug mode...
/snap/flutter/current/usr/bin/ld: warning: librt.so.1, needed by _deps/sentry-native-build/libsentry.so, not found (try using -rpath or -rpath-link)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Building Linux application...                                           
Error: Build process failed

Are you willing to submit a PR?

None

@romtsn
Copy link
Member

romtsn commented Mar 17, 2025

hi @jefflongo thanks for opening the issue.

Generally librt.so should be present in the OS as it's part of libc (or any other flavour of it). Maybe you could try this workaround, or specify a -lrt linker flag for your build?

@JoshuaMoelans maybe you have some ideas here?

@jefflongo
Copy link
Author

jefflongo commented Mar 17, 2025

hi @jefflongo thanks for opening the issue.

Generally librt.so should be present in the OS as it's part of libc (or any other flavour of it). Maybe you could try this workaround, or specify a -lrt linker flag for your build?

@JoshuaMoelans maybe you have some ideas here?

This workaround did not work. I suspect it has to do with this:

$ find / -name librt.so 2>/dev/null
/snap/flutter/145/usr/lib/x86_64-linux-gnu/librt.so
/snap/flutter/149/usr/lib/x86_64-linux-gnu/librt.so

$ readlink /snap/flutter/145/usr/lib/x86_64-linux-gnu/librt.so
/snap/flutter/current/lib/x86_64-linux-gnu/librt.so.1

$ ls /snap/flutter/current/lib/x86_64-linux-gnu -l | grep librt
-rw-r--r-- 1 root root   38888 Jan 21 07:23 librt-2.31.so
lrwxrwxrwx 1 root root      13 Apr 30  2024 librt.so.1 -> librt-2.31.so

It's likely using this librt contained in flutter. At first glance it would seem it's pointing to a valid librt.. I also tried running my build in my GitHub CI pipeline and it built successfully (both my machine and the pipeline run Ubuntu 24.04), so whatever this problem is, it's localized to my environment.

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Mar 17, 2025
@jefflongo
Copy link
Author

I uninstalled flutter via snap and installed manually, this fixed the problem.

@kahest kahest closed this as completed Mar 18, 2025
@github-project-automation github-project-automation bot moved this from Needs Discussion to Done in Mobile SDKs Mar 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Status: Done
Development

No branches or pull requests

3 participants