-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid Argument: Failed to load dynamic library pdfrx.framework on iOS #117
Comments
The exception seems due to pdfium. |
What iPhone (or Simulator) are you using? |
I'm using iPhone 12 pro with iOS 16.5
|
I found the issue! To make pdfrx working, in the pod file we should add use_frameworks!
But, in my app, I have a pod that must be linked statically so I have to set use_framwork :linkage => :static On the other hand, if I remove linkage => static I have an issue during pod install:
you can find something interesting to fix the issue in pdfrx here: |
I confirm. I tried in this way and it worked:
so that the other dependencies that require static linking worked,
so that the symbols are loaded from the static linked library inside the process, Now we should find a way to manage both cases (dynamic or static linking) in your code. |
So, do you want me to introduce some mechanism to choose one of DynamicLibrary.process and DynamicLibrary.open? |
@ugochirico Could you please check PR #119? If it's feasible solution to your issue, I'll merge it to the master. |
no. it doesn't work. It seems as it cannot find the symbols in the process. 0 DynamicLibrary.lookup (dart:ffi-patch/ffi_dynamic_library_patch.dart:33:70) |
You told me that the following code worked:
So what do you expect me to do? |
Yes, it worked when I changed it in the version ^1.0.51. I don't know why now it doesn't work with this new branch. Anyway, I tried with a different approach by changing the podfile to specify that pdfrx must be loaded dynamically as a framework and I was able to make it working, without any change in pdfrx. This is my updated podfile that works:
|
@ugochirico |
It's very strange. On my Mac, adding that lines in podfile it works. My colleague pull our app on his mac, with the same podfile and it doesn't work anymore. Same error as before. Did you try to set |
Finally we was able to find the correct solution.
|
I'm using pdfrx 1.0.51. I loaded the PdfViewer from a Uint8List in this way:
It works on Android and Web but on iOS I got this error:
Failed to load dynamic library 'pdfrx.framework/pdfrx': dlopen(pdfrx.framework/pdfrx, 0x0001...
The error appears inside the PdfViewer as in the attached screenshot
The text was updated successfully, but these errors were encountered: