espresso3389 / pdfrx

pdfrx is yet another PDF viewer implementation that built on the top of pdfium. The plugin currently supports Android, iOS, Windows, macOS, Linux, and Web.
MIT License
79 stars 43 forks source link

Android SDK API 22: Invalid argument(s): Failed to lookup symbol 'FPDF_InitLibraryWithConfig': undefined symbol: FPDF_InitLibraryWithConfig #203

Open mmuttaqin opened 5 days ago

mmuttaqin commented 5 days ago

Info: Invalid argument(s): Failed to lookup symbol 'FPDF_InitLibraryWithConfig': undefined symbol: FPDF_InitLibraryWithConfig

when use PdfViewer.asset

espresso3389 commented 5 days ago

Please explain your environment; flutter doctor -v and your device. And, if you use any PDF related library with pdfrx, please list them.

mmuttaqin commented 5 days ago

[✓] Flutter (Channel stable, 3.22.2, on Mac OS X 10.15.7 19H2026 darwin-x64, locale en-ID) • Flutter version 3.22.2 on channel stable at /Users/mmuttaqin/Documents/DEVELOPMENT/FLUTTER/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 761747bfc5 (4 weeks ago), 2024-06-05 22:15:13 +0200 • Engine revision edd8546116 • Dart version 3.4.3 • DevTools version 2.34.3

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at /Users/mmuttaqin/Library/Android/sdk • Platform android-34, build-tools 34.0.0 • ANDROID_HOME = /Users/mmuttaqin/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160) • All Android licenses accepted.

[!] Xcode - develop for iOS and macOS ✗ Xcode installation is incomplete; a full installation is necessary for iOS and macOS development. Download at: https://developer.apple.com/xcode/ Or install Xcode via the App Store. Once installed, run: sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer sudo xcodebuild -runFirstLaunch ! CocoaPods 1.10.2 out of date (1.13.0 is recommended). CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side. Without CocoaPods, plugins will not work on iOS or macOS. For more info, see https://flutter.dev/platform-plugins To upgrade see https://guides.cocoapods.org/using/getting-started.html#updating-cocoapods for instructions.

[✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.3) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)

[✓] VS Code (version 1.90.2) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.90.0

[✓] Connected device (4 available) • Nexus 10 (mobile) • R32D801FR5X • android-arm • Android 5.1.1 (API 22) • Redmi Note 8 Pro (mobile) • eqivrstocyzdkrpf • android-arm64 • Android 11 (API 30) • macOS (desktop) • macos • darwin-x64 • Mac OS X 10.15.7 19H2026 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 126.0.6478.127

[✓] Network resources • All expected network resources are available.

not working at old android Nexus 10 (mobile) API 22

mmuttaqin commented 5 days ago

Exception: Invalid argument(s): Failed to lookup symbol 'FPDF_InitLibraryWithConfig': undefined symbol: FPDF_InitLibraryWithConfig I/flutter (16691): Stack trace: #0 DynamicLibrary.lookup (dart:ffi-patch/ffi_dynamic_library_patch.dart:33:70) I/flutter (16691): #1 pdfium._FPDF_InitLibraryWithConfigPtr (package:pdfrx/src/pdfium/pdfium_bindings.dart:33:80) I/flutter (16691): #2 pdfium._FPDF_InitLibraryWithConfigPtr (package:pdfrx/src/pdfium/pdfium_bindings.dart) I/flutter (16691): #3 pdfium._FPDF_InitLibraryWithConfig (package:pdfrx/src/pdfium/pdfium_bindings.dart:35:44) I/flutter (16691): #4 pdfium._FPDF_InitLibraryWithConfig (package:pdfrx/src/pdfium/pdfium_bindings.dart) I/flutter (16691): #5 pdfium.FPDF_InitLibraryWithConfig (package:pdfrx/src/pdfium/pdfium_bindings.dart:26:12) I/flutter (16691): #6 _init. (package:pdfrx/src/pdfium/pdfrx_pdfium.dart:46:14) I/flutter (16691): #7 using (package:ffi/src/arena.dart:124:31) I/flutter (16691): #8 _init (package:pdfrx/src/pdfium/pdfrx_pdfium.dart:38:3) I/flutter (16691): #9 PdfDocumentFactoryImpl.openCustom (package:pdfrx/src/pdfium/pdfrx_pdfium.dart:150:5) I/flutter (16691): #10 PdfDocumentFactoryImpl._openData (package:pdfrx/src/pdfium/pdfrx_pdfium.dart:119:12) I/flutter (16691): #11 PdfDocumentFactoryImpl.openAsset (package:pdfrx/src/pdfium/pdfrx_pdfium.dart:62:18) I/flutter (16691): I/flutter (16691): #12 PdfDocumentListenable.load. (package:pdfrx/src/pdf_document_ref.dart:401:22) I/flutter (16691): I/flutter (16691): #13 objectSynchronized. (package:synchronized/src/extension_impl.dart:37:18) I/flutter (16691): I/flutter (16691): #14 BasicLock.synchronized (package:synchronized/src/basic_lock.dart:33:16) I/flutter (16691): I/flutter (16691): #15 objectSynchronized (package:synchronized/src/extension_impl.dart:34:12) I/flutter (16691): I/flutter (16691): #16 PdfDocumentListenable.load (package:pdfrx/src/pdf_document_ref.dart:395:12) I/flutter (16691):

espresso3389 commented 5 days ago

Thanks for the info. Recentlty I updated libpdfium.so on 1.0.72 and it "might" introduce some incompatibility with older SDK version (I didn't confirm that).

Could you test the following versions one by one?

espresso3389 commented 5 days ago

FYI: I've confirmed the existances of FPDF_InitLibraryWithConfig on the latest libpdfium.so binaries used by pdfrx:

kawasaki@red:/mnt/d/pdfrx/android/.lib/chromium%2F6555$ nm -D x86/libpdfium.so | grep FPDF_InitLibraryWithConfig
00318b79 T FPDF_InitLibraryWithConfig
kawasaki@red:/mnt/d/pdfrx/android/.lib/chromium%2F6555$ nm -D x86_64/libpdfium.so | grep FPDF_InitLibraryWithConfig
00000000003157f1 T FPDF_InitLibraryWithConfig
kawasaki@red:/mnt/d/pdfrx/android/.lib/chromium%2F6555$ nm -D arm64-v8a/libpdfium.so | grep FPDF_InitLibraryWithConfig
0000000000333464 T FPDF_InitLibraryWithConfig
kawasaki@red:/mnt/d/pdfrx/android/.lib/chromium%2F6555$ nm -D armeabi-v7a/libpdfium.so | grep FPDF_InitLibraryWithConfig
0024285d T FPDF_InitLibraryWithConfig

Every so files for Android correctly contains FPDF_InitLibraryWithConfig. I don't have any Android devices of API 22. So it's very difficult to check the actual loading behavior :(

espresso3389 commented 1 day ago

@mmuttaqin Android 22 is too old to test on my side. It's up to you (or someone else who also need Android 22 support) to test the things on Android 22 or I can only to close the issue without fixing it.