wang-bin / fvp

Flutter video player plugin for all desktop+mobile platforms. download prebuilt examples from github actions. https://pub.dev/packages/fvp
BSD 3-Clause "New" or "Revised" License
197 stars 31 forks source link

MacOS app crashes when hardened Runtime is on #157

Closed Ansh-Rathod closed 1 month ago

Ansh-Rathod commented 1 month ago

in order to run fvp do i need to keep this Hardened Runtime off?

app crashes as soon as I open any video when Hardened Runtime is "Yes"

Screenshot 2024-09-27 at 2 02 17 PM
wang-bin commented 1 month ago

show me backtrace. there are many options in hardened runtime, can you show me what options are selected?

Ansh-Rathod commented 1 month ago

btw i made it work using

        <key>com.apple.security.cs.allow-unsigned-executable-memory</key>
        <true />
        <key>com.apple.security.cs.allow-dyld-environment-variables</key>
        <true />
        <key>com.apple.security.cs.disable-library-validation</key>
        <true />
Ansh-Rathod commented 1 month ago
Screenshot 2024-09-27 at 2 27 26 PM
wang-bin commented 1 month ago

I add environment variable MDK_CLOG=1 to print logs in xcode, and see this error

dlopen error: dlopen(/Users/wangbin/Library/Developer/Xcode/DerivedData/Runner-cwqiavykvslgxkajggfmfuyzxzvh/Build/Products/Debug/fvp_example.app/Contents/Frameworks/mdk.framework/Versions/A/libffmpeg.7.dylib, 0x0005): tried: '/Users/wangbin/Library/Developer/Xcode/DerivedData/Runner-cwqiavykvslgxkajggfmfuyzxzvh/Build/Products/Debug/libffmpeg.7.dylib' (no such file), '/usr/lib/system/introspection/libffmpeg.7.dylib' (no such file, not in dyld cache), '/Users/wangbin/Library/Developer/Xcode/DerivedData/Runner-cwqiavykvslgxkajggfmfuyzxzvh/Build/Products/Debug/fvp_example.app/Contents/Frameworks/mdk.framework/Versions/A/libffmpeg.7.dylib' (code signature in <5F25615F-4458-330A-8600-F119E49EF563> '/Users/wangbin/Library/Developer/Xcode/DerivedData/Runner-cwqiavykvslgxkajggfmfuyzxzvh/Build/Products/Debug/fvp_example.app/Contents/Frameworks/mdk.framework/Versions/A/libffmpeg.7.dylib' not valid for use in process: mapping process and mapped file (non-platform) have different Team IDs), '/System/Volumes/Preboot/Cryptexes/OS/Users/wangbin/Library/Developer/Xcode/DerivedData/Runner-cwqiavykvslgxkajggfmfuyzxzvh/Build/Products/Debug/fvp_example.app/Contents/Frameworks/mdk.framework/Versions/A/libffmpeg.7.dylib' (no such file), '/Users/wangbin/Library/Developer/Xcode/DerivedData/Runner-cwqiavykvslgxkajggfmfuyzxzvh/Build/Products/Debug/fvp_example.app/Contents/Frameworks/mdk.framework/Versions/A/libffmpeg.7.dylib' (code signature in <5F25615F-4458-330A-8600-F119E49EF563> '/Users/wangbin/Library/Developer/Xcode/DerivedData/Runner-cwqiavykvslgxkajggfmfuyzxzvh/Build/Products/Debug/fvp_example.app/Contents/Frameworks/mdk.framework/Versions/A/libffmpeg.7.dylib' not valid for use in process: mapping process and mapped file (non-platform) have different Team IDs)

there's libffmpeg.7.dylib in mdk.framework but not correctly signed, so your have 2 solutions

Ansh-Rathod commented 1 month ago

Thank you for the detailed solution! you're the best.