document-viewer icon indicating copy to clipboard operation
document-viewer copied to clipboard

Getting error while trying to open pdf. and app is crashing.

Open SujeetKr9 opened this issue 6 years ago • 25 comments

org.sufficientlysecure.viewer E/Document Viewer.LibraryLoader: Native library cannot be loaded: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/org.sufficientlysecure.viewer-IA7jlnRFefU-WQQ1bJ2wdQ==/base.apk"],nativeLibraryDirectories=[/data/app/org.sufficientlysecure.viewer-IA7jlnRFefU-WQQ1bJ2wdQ==/lib/x86, /system/lib, /vendor/lib]]] couldn't find "libebookdroid.so"

SujeetKr9 avatar Nov 23 '19 07:11 SujeetKr9

Reinstalling the app may help

ildar avatar Nov 23 '19 13:11 ildar

See: https://github.com/SufficientlySecure/document-viewer/issues/262#issuecomment-338271054

hwasiti avatar Feb 13 '20 10:02 hwasiti

See: #262 (comment)

can You Sir please explain it more

bqytallhsirlkm avatar Jan 30 '21 13:01 bqytallhsirlkm

@bqytallhsirlkm current gradle configuration (in master branch) doesn't automatically build native libraries. You need to manually build c/c++ sources (explained in readme) and then build project itself.

matsievskiysv avatar Jan 30 '21 13:01 matsievskiysv

@bqytallhsirlkm current gradle configuration (in master branch) doesn't automatically build native libraries. You need to manually build c/c++ sources (explained in readme) and then build project itself.

Thank you brother Sorry brother 1- Download NDK & CMake 2- in jni file. should recompile mupdf

Sorry brother I'm a beginner in Andriod studio I didn't understand Readme Can you brother explain it in detail? if you don't mind

bqytallhsirlkm avatar Feb 01 '21 13:02 bqytallhsirlkm

From Android Studio:

  1. Select Tools->SDK Manager. From there install sdk and ndk (you don't need CMake for this project).

From Terminal:

  1. Download MuPDF and DjVULibre and generate fonts by running command ./init.sh from the project root.
  2. Go to the document-viewer folder and run command ndk-build. If you get the command not found error, then you need to add ndk

From Android Studio:

  1. Build.

matsievskiysv avatar Feb 01 '21 18:02 matsievskiysv

From Android Studio:

1. Select Tools->SDK Manager. From there install sdk and [ndk](https://developer.android.com/studio/projects/install-ndk?hl=FR) (you don't need CMake for this project).

From Terminal:

1. Download MuPDF and DjVULibre and generate fonts by running command `./init.sh` from the project root.

2. Go to the `document-viewer` folder and run command `ndk-build`. If you get the `command not found` error, then you need to [add ndk](https://www.howtogeek.com/658904/how-to-add-a-directory-to-your-path-in-linux/)

From Android Studio:

1. Build.

Sorry brother I didn't know whats the wrong seem Error!

1-download NDK & DjVULibre and generate fonts https://www.mediafire.com/view/p8hbsuunmee366x/Screenshot_%2528106%2529.png/file#

bqytallhsirlkm avatar Feb 03 '21 20:02 bqytallhsirlkm

For the second step you need a terminal. On Windows you may use Cygwin.

matsievskiysv avatar Feb 03 '21 20:02 matsievskiysv

For the second step you need a terminal. On Windows you may use Cygwin.

when I run ./init.sh from the project root. give this message

bash: make: command not found can't find file to patch at input line 5 Perhaps you used the wrong -p or --strip option? The text leading up to this was:

|diff --git a/include/mupdf/fitz/context.h b/include/mupdf/fitz/context.h |index 35f4f74f..6bd4661d 100644 |--- a/include/mupdf/fitz/context.h |+++ b/include/mupdf/fitz/context.h

File to patch:

bqytallhsirlkm avatar Feb 04 '21 09:02 bqytallhsirlkm

Do you have files in document-viewer/document-viewer/jni/mupdf/mupdf?

matsievskiysv avatar Feb 04 '21 09:02 matsievskiysv

Do you have files in document-viewer/document-viewer/jni/mupdf/mupdf?

mupdf/mupdf Empty nothing brother

bqytallhsirlkm avatar Feb 04 '21 19:02 bqytallhsirlkm

You have to install git and run from terminal git submodule update --init --recursive --force

matsievskiysv avatar Feb 04 '21 20:02 matsievskiysv

You have to install git and run from terminal git submodule update --init --recursive --force

Done Brother Pic

bqytallhsirlkm avatar Feb 05 '21 06:02 bqytallhsirlkm

You don't actually download mupdf and djvulibre by hand. You download them by issuing ./init.sh from the project root. They will appear in the appropriate folders in document-viewer/document-viewer/jni/.

matsievskiysv avatar Feb 05 '21 09:02 matsievskiysv

You don't actually download mupdf and djvulibre by hand. You download them by issuing ./init.sh from the project root. They will appear in the appropriate folders in document-viewer/document-viewer/jni/.

Sorry Brother for the last time First, download document-viewer Secondly, run in Android studio And Add NDK 3rd download mupdf but how can I generate fonts When I run the file init.sh . from the project root This appears and then disappears Pic

bqytallhsirlkm avatar Feb 10 '21 11:02 bqytallhsirlkm

  1. It looks like you've downloaded zip archive of the project. You need to clone it instead. Remove document-viewer folder and issue command
git clone --recurse-submodules https://github.com/SufficientlySecure/document-viewer.git

This command will download project, mupdf and djvulibre.

  1. You don't have build tools (make, gcc etc) installed. You need to install cygwin and use its terminal instead of windows shell.

3rd download mupdf but how can I generate fonts

They are generated when you run init.sh.

matsievskiysv avatar Feb 10 '21 12:02 matsievskiysv

yes I downloaded a zip archive thanks for this note

  1. I clone it
  2. generate fronts by a run from root project init.sh
  3. add NDK But the problem is the same

bqytallhsirlkm avatar Feb 11 '21 09:02 bqytallhsirlkm

But the problem is the same

which one?

matsievskiysv avatar Feb 11 '21 14:02 matsievskiysv

But the problem is the same

which one?

java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/org.sufficientlysecure.viewer-IA7jlnRFefU-WQQ1bJ2wdQ==/base.apk"],nativeLibraryDirectories=[/data/app/org.sufficientlysecure.viewer-IA7jlnRFefU-WQQ1bJ2wdQ==/lib/x86, /system/lib, /vendor/lib]]] couldn't find "libebookdroid.so"

bqytallhsirlkm avatar Feb 11 '21 17:02 bqytallhsirlkm

Did you run ndk-build after running init.sh as described above?

matsievskiysv avatar Feb 11 '21 19:02 matsievskiysv

Did you run ndk-build after running init.sh as described above?

Yes Brother & give me this error

image

bqytallhsirlkm avatar Feb 12 '21 12:02 bqytallhsirlkm

Why do you have a backslash in your pdf.h path?

matsievskiysv avatar Feb 12 '21 16:02 matsievskiysv

Why do you have a backslash in your pdf.h path?

my path for NDK C:\Users\bqytallhsirlkm\AppData\Local\Android\Sdk\ndk\android-ndk-r15c-windows-x86_64\android-ndk-r15c + /ndk-build

excuse me brother whats the wrong with the path?

bqytallhsirlkm avatar Feb 13 '21 11:02 bqytallhsirlkm

Well, you have mixed forward and back slashes in your pdf.h path (yellow highlight on the picture). It seems that there's a mix of native and UNIX style path concatenations. You may try inspecting ndk-build log by running ndk-build --dry-run. However, it would be much simpler to setup dual-boot or virtual machine with GNU/Linux.

matsievskiysv avatar Feb 13 '21 12:02 matsievskiysv

Well, you have mixed forward and back slashes in your pdf.h path (yellow highlight on the picture). It seems that there's a mix of native and UNIX style path concatenations. You may try inspecting ndk-build log by running ndk-build --dry-run. However, it would be much simpler to setup dual-boot or virtual machine with GNU/Linux.

so my error C:/Users/bqytallhsirlkm/AppData/Local/Android/Sdk/ndk/android-ndk-r15c-windows-x86_64/android-ndk-r15c**/**ndk-build

But it gives me the seeming error

bqytallhsirlkm avatar Feb 13 '21 13:02 bqytallhsirlkm