Closed alwc closed 5 years ago
Getting the same issue! Any ideas on how to solve this
+1
@JakeWade3 @AngryDuckFTW It has been a while since I fixed the problem, but here are the instructions to fix it.
opencv2.framework
otool -L opencv2.framework/opencv2
in your terminal, you should get something like this$ otool -L opencv2.framework/opencv2
opencv2.framework/opencv2:
/Users/alwc/projects/opencv/ios_arm64_dynamic_test/build/build-arm64-iphoneos/lib/Release/opencv2.framework/opencv2 (compatibility version 4.1.0, current version 4.1.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.4)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.200.5)
Note that the opencv2.framework/opencv2
's parent (i.e. first file path) is a fixed path on your computer.
install_name_tool -id "@rpath/opencv2.framework/opencv2" opencv2.framework/opencv2
in your terminal and you'll see the opencv2.framework/opencv2
's parent has become @rpath
:$ otool -L opencv2.framework/opencv2
opencv2.framework/opencv2:
@rpath/opencv2.framework/opencv2 (compatibility version 4.1.0, current version 4.1.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.4)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.200.5)
These 3 steps should be able to solve your dynamic build problem.
I've tried
pod install
with the followingPodfile
,but I'm getting the following error in Xcode when I'm try to run it on a simulator
When I look at
/Users/alwc/Library/Caches/CocoaPods/Pods/Release/OpenCV-Dynamic/4.0.1-bbf99/
, I realize there are onlySo the loaded path is incorrect.
If I manually create
/ios/build/build-iphoneos/lib/Release/opencv2.framework/opencv2
in4.0.1-bbf99
, then it works in simulator. If I build and run this on my iPhone X, I'll still get the samedyld: Library not loaded:
error despite the fact that I manually created the path in4.0.1-bbf99
. How can I fix this?