Skip to content
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

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

Open
SujeetKr9 opened this issue Nov 23, 2019 · 25 comments
Open

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

SujeetKr9 opened this issue Nov 23, 2019 · 25 comments

Comments

@SujeetKr9
Copy link

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
Copy link

ildar commented Nov 23, 2019 via email

@hwasiti
Copy link
Contributor

hwasiti commented Feb 13, 2020

See:
#262 (comment)

@bqytallhsirlkm
Copy link

See:
#262 (comment)

can You Sir please explain it more

@matsievskiysv
Copy link
Contributor

@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
Copy link

@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
Copy link
Contributor

matsievskiysv commented Feb 1, 2021

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
Copy link

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
Copy link
Contributor

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

@bqytallhsirlkm
Copy link

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
Copy link
Contributor

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

@bqytallhsirlkm
Copy link

bqytallhsirlkm commented Feb 4, 2021

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

mupdf/mupdf Empty nothing brother

@matsievskiysv
Copy link
Contributor

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

@bqytallhsirlkm
Copy link

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

Done Brother Pic

@matsievskiysv
Copy link
Contributor

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
Copy link

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
Copy link
Contributor

  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.

@bqytallhsirlkm
Copy link

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
Copy link
Contributor

But the problem is the same

which one?

@bqytallhsirlkm
Copy link

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
Copy link
Contributor

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

@bqytallhsirlkm
Copy link

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

Yes Brother & give me this error

image

@matsievskiysv
Copy link
Contributor

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

@bqytallhsirlkm
Copy link

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
Copy link
Contributor

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants