SufficientlySecure / document-viewer

Document Viewer is a highly customizable document viewer for Android.
GNU General Public License v3.0
524 stars 155 forks source link

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

Open SujeetKr9 opened 5 years ago

SujeetKr9 commented 5 years ago

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"

ildar commented 5 years ago

Reinstalling the app may help

hwasiti commented 4 years ago

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

bqytallhsirlkm commented 3 years ago

See: #262 (comment)

can You Sir please explain it more

matsievskiysv commented 3 years ago

@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.

bqytallhsirlkm commented 3 years ago

@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

matsievskiysv commented 3 years ago

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.
bqytallhsirlkm commented 3 years ago

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#

matsievskiysv commented 3 years ago

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

bqytallhsirlkm commented 3 years ago

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:

matsievskiysv commented 3 years ago

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

bqytallhsirlkm commented 3 years ago

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

mupdf/mupdf Empty nothing brother

matsievskiysv commented 3 years ago

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

bqytallhsirlkm commented 3 years ago

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

Done Brother Pic

matsievskiysv commented 3 years ago

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/.

bqytallhsirlkm commented 3 years ago

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

matsievskiysv commented 3 years ago
  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.

  2. 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.

bqytallhsirlkm commented 3 years ago

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
matsievskiysv commented 3 years ago

But the problem is the same

which one?

bqytallhsirlkm commented 3 years ago

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"

matsievskiysv commented 3 years ago

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

bqytallhsirlkm commented 3 years ago

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

Yes Brother & give me this error

image

matsievskiysv commented 3 years ago

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

bqytallhsirlkm commented 3 years ago

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?

matsievskiysv commented 3 years ago

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.

bqytallhsirlkm commented 3 years ago

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