-
Notifications
You must be signed in to change notification settings - Fork 86
Open
Description
Description
The pre-built FFmpeg frameworks for macOS (arm64 architecture) contain hardcoded absolute paths to Homebrew libraries, causing the application to crash on machines that don't have these specific Homebrew packages installed.
Error
dyld: Library not loaded: /opt/homebrew/opt/libiconv/lib/libiconv.2.dylib
Referenced from: <UUID> /path/to/app.app/Contents/Frameworks/libswresample.framework/Versions/A/libswresample
Reason: tried: '/opt/homebrew/opt/libiconv/lib/libiconv.2.dylib' (no such file)
Affected Libraries
The frameworks reference these Homebrew libraries with absolute paths:
/opt/homebrew/opt/libiconv/lib/libiconv.2.dylib-
/opt/homebrew/opt/libsamplerate/lib/libsamplerate.0.dylib
-
-
/opt/homebrew/opt/srt/lib/libsrt.1.5.dylib
-
-
-
-
- And others (fontconfig, freetype, fribidi, harfbuzz, glib, etc.)
-
-
-
-
-
-
Environment
-
-
-
-
-
-
-
- Platform: macOS (arm64/Apple Silicon)
-
-
-
-
-
-
-
-
- FFmpeg Kit Version: 4.1.0 (from release 8.0.0-full-gpl)
-
-
-
-
-
-
-
-
-
-
- Frameworks: Downloaded from GitHub releases
-
-
-
-
-
Reproduction
- Download pre-built macOS frameworks from releases
-
- Integrate into Flutter project
-
- Run on macOS machine without Homebrew or without specific packages
-
- App crashes on launch with dyld error
Investigation
Using otool -L on the frameworks reveals hardcoded absolute Homebrew paths instead of @rpath or system libraries.
Root Cause
The frameworks were likely built on a machine with Homebrew dependencies, and the build process didn't use proper flags to make paths relative or bundle dependencies.
Current Workaround
Install the required Homebrew packages:
brew install libiconv libsamplerate srtNote: This works for development but not for distribution.
Proposed Solutions
- Short-term: Document Homebrew requirements in README
-
- Long-term: Rebuild frameworks with
-Wl,-headerpad_max_install_nameslinker flag and proper dependency bundling
- Long-term: Rebuild frameworks with
Additional Context
- x86_64 architecture doesn't have this issue
-
- Only arm64 has hardcoded Homebrew paths
-
-
- This significantly affects macOS distribution
-
Metadata
Metadata
Assignees
Labels
No labels