Closed Ansh-Rathod closed 1 month ago
show me backtrace. there are many options in hardened runtime, can you show me what options are selected?
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 />
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
Build Phase
, add a New Run Script Phase
with content
[ -n "$CODE_SIGN_IDENTITY" ] && find "$BUILT_PRODUCTS_DIR" -depth -path "*mdk.framework/*" -name "lib*.dylib" -exec codesign -f -vvvv -s"${EXPANDED_CODE_SIGN_IDENTITY}" ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements,flags {} \;
Disable Library Validation
in hardened runtimeThank you for the detailed solution! you're the best.
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"