I use SwiftPM to wrapper the Tesseract C library by official guide requiring-system-libraries. And it works on my mac device. However, the archived App crash on the other device without the Tesseract installation.
I notice the SwiftPM does not contain dylib so the Xcode does not embed the libraries. After adding the
libtesseract.dylib under the
/usr/local/lib/ to Xcode - App Target - "Frameworks, Libraries, and Embedded Content" section. The app size looks normal but still have that error message on other people device.
Termination Reason: DYLD, [0x1] Library missing
Application Specific Information:
dyld: launch, loading dependent libraries
Dyld Error Message:
Library not loaded: /usr/local/opt/tesseract/lib/libtesseract.4.dylib
Referenced from: /Users/USER/Downloads/ImageReader.app/Contents/MacOS/ImageReader
Reason: image not found
The dylib is already embedded under the
./Content/Frameworks/. How to make the app search and use it?