I have a flutter package git_bindings
which requires certain ios Frameworks in order to work - libgit2, libssh, libssl and libcrypto. I have all these Frameworks compiled and ready. The code worked perfectly when it was all in one application, I'm now trying to split this git code into its own package.
In the package's ios/git_bindings.podspec
file, I added the following -
s.vendored_frameworks = 'Frameworks/libssl.framework', 'Frameworks/libcrypto.framework', 'Frameworks/libssh2.framework', 'Frameworks/libgit2.framework'
and placed the frameworks in that location.
While trying to build the example application, I keep getting the error ld: framework not found libssh2
(or some of the other frameworks, depending on how I change the vendored_frameworks
line)
I'm attaching the full verbose output below -
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
-target
x86_64-apple-ios8.0-simulator -isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13
.2.sdk -L/Users/vishesh/src/gitjournal/git_bindings/example/build/ios/Debug-iphonesimulator
-L/Users/vishesh/src/gitjournal/git_bindings/example/build/ios/Debug-iphonesimulator/git_bindings
-L/Users/vishesh/src/gitjournal/git_bindings/example/build/ios/Debug-iphonesimulator/path_provider
-L/Users/vishesh/src/gitjournal/git_bindings/example/build/ios/Debug-iphonesimulator/git_bindings
-L/Users/vishesh/src/gitjournal/git_bindings/example/build/ios/Debug-iphonesimulator/path_provider
-L/Users/vishesh/src/gitjournal/git_bindings/example/ios/Flutter
-F/Users/vishesh/src/gitjournal/git_bindings/example/build/ios/Debug-iphonesimulator
-F/Users/vishesh/src/gitjournal/git_bindings/example/ios/Pods/../.symlinks/plugins/git_bindings/ios/Frameworks
-F/Users/vishesh/src/gitjournal/git_bindings/example/ios/Pods/../Flutter
-F/Users/vishesh/src/gitjournal/git_bindings/example/ios/Pods/../.symlinks/plugins/git_bindings/ios/Frameworks
-F/Users/vishesh/src/gitjournal/git_bindings/example/ios/Pods/../Flutter
-F/Users/vishesh/src/gitjournal/git_bindings/example/ios/Flutter -filelist
/Users/vishesh/Library/Developer/Xcode/DerivedData/Runner-fzwdbhdmgbfzdugxuzwluizyxval/Build/Intermediates.noi
ndex/Runner.build/Debug-iphonesimulator/Runner.build/Objects-normal/x86_64/Runner.LinkFileList
-Xlinker -rpath
-Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -Xlinker
-rpath -Xlinker
@executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -Xlinker -rpath
-Xlinker
@executable_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker
/Users/vishesh/Library/Developer/Xcode/DerivedData/Runner-fzwdbhdmgbfzdugxuzwluizyxval/Build/Intermediates.noi
ndex/Runner.build/Debug-iphonesimulator/Runner.build/Objects-normal/x86_64/Runner_lto.o -Xlinker
-export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc
-fobjc-link-runtime
-ObjC -lgit_bindings -lpath_provider -framework Flutter -framework libcrypto -framework libgit2
-framework
libssh2 -framework libssl -framework Flutter -ObjC -lgit_bindings -lpath_provider -framework
Flutter
-framework libcrypto -framework libgit2 -framework libssh2 -framework libssl -framework Flutter
-Xlinker
-sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker
/Users/vishesh/Library/Developer/Xcode/DerivedData/Runner-fzwdbhdmgbfzdugxuzwluizyxval/Build/Intermediates.noi
ndex/Runner.build/Debug-iphonesimulator/Runner.build/Runner.app-Simulated.xcent -lPods-Runner
-Xlinker
-dependency_info -Xlinker
/Users/vishesh/Library/Developer/Xcode/DerivedData/Runner-fzwdbhdmgbfzdugxuzwluizyxval/Build/Intermediates.noi
ndex/Runner.build/Debug-iphonesimulator/Runner.build/Objects-normal/x86_64/Runner_dependency_info.dat -o
/Users/vishesh/src/gitjournal/git_bindings/example/build/ios/Debug-iphonesimulator/Runner.app/Runner
ld: framework not found libcrypto
clang: error: linker command failed with exit code 1 (use -v to see invocation)
It seems that the correct flag and path -F/Users/vishesh/src/gitjournal/git_bindings/example/ios/Pods/../.symlinks/plugins/git_bindings/ios/Frameworks
is being passed to clang for it to search in correct location, but it still doesn't find the frameworks.
Does anyone have any ideas?