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

The app crashes when I use my own libmupdf.so #208

Closed
bagusflyer opened this issue Mar 6, 2014 · 23 comments
Closed

The app crashes when I use my own libmupdf.so #208

bagusflyer opened this issue Mar 6, 2014 · 23 comments

Comments

@bagusflyer
Copy link

Hi, my app crashes when I use my own libmupdf.so. The error message is something like:" The native function doesn't exist in MuCore.openFile()". I guess it because I used my own libmupdf.so (I just compiled it by myself. The reason I compiled it is because I want to use x86 library. Anyway it crashes even when I'm using my own armeabi-v7a library.)

Did you compile your mupdf with some special flag? Thanks

@bagusflyer
Copy link
Author

I mean did you change anything in mupdf core (native) part? And what is the version of mupdf you based on in your project?

@intrications
Copy link
Collaborator

I've no idea because I wasn't involved in the project at the beginning. You may be able to tell by looking through the git history.

I do know that the version of MuPDF used is quite old so I'm not surprised that you can't just drop in your compiled files. Maybe the Java files need updating as well but I don't know if they were customized. This line might be relevant:

https://github.com/libreliodev/android/blob/master/src/com/artifex/mupdf/MuPDFCore.java#L34

@bagusflyer
Copy link
Author

Thanks for your reply. Do you consider to upgrade the mupdf part? Because the performance of new mupdf (1.3) is much better. I'll look into it when I have time.

@intrications
Copy link
Collaborator

@bagusflyer Yes, an update to MuPDF would be great. But, as discussed on http://stackoverflow.com/questions/17594656/show-two-pages-on-landscape-mode-on-mupdf/17597401?noredirect=1#comment33691832_17597401, the changes to show two pages in landscape would need to be preserved.

@bagusflyer
Copy link
Author

I managed to integrate the mupdf 1.3 (the latest version). The only change for libreliodev is the package name. I changed it from com.artifex.mupdf to com.artifex.mupdfdemo, then everything is fine. I even can use x86 libmupdf.so in Genymotion emulator now. Do you want to do corresponding modification? I can send you the latest so files. (I think new mupdf is much faster.)

@intrications
Copy link
Collaborator

Can you send a pull request with the changes?

@bagusflyer
Copy link
Author

The other way is to change the mupdf.c and compile the mupdf library. I think this is simpler. But I have a problem to pull request because I'm not using Eclipse. Instead I'm using Android Studio to compile my application. I think the easiest way is I send you the compiled library. Is that ok?

@intrications
Copy link
Collaborator

@bagusflyer I don't have much experience with using native code on Android. Do you need to use the Android NDK to compile MuPDF?

I usually use Android Studio as well, but have to use Eclipse for this project.

You can send any files you have changed to the email address on my github profile page:
https://github.com/intrications

@intrications
Copy link
Collaborator

As @bagusflyer suggested updating mudpf.c to use com/artifex/mupdf rather than com/artifex/mupdfdemo allowed me to compile and just replace the so files in the libs folder.

Pushed updated libraries in 6eb1e6e

@suntehnik
Copy link
Collaborator

@bagusflyer I did the initial mupdf integration with the project. I did some tests with latest mupdf release and found a lot of OOM exceptions there. That's why the project is stick with the old one.

@harveyslash
Copy link

hello.
I am compiling mupdf 1.5 ,but it does not work with genymotion emulator.
What changes should i make before rebuilding the source ?
I am a little new to android, thank you

@suntehnik
Copy link
Collaborator

You should use mupdf bundled with this project. Other versions will not work.

@harveyslash
Copy link

but isnt this version old ?

@suntehnik
Copy link
Collaborator

Doesn't matter how it's old. It works. That matters. Newer versions has a lot of functionality and bugs. One of the most important - OutOfMemory exceptions.
16 èþíÿ 2014 ã., â 11:36, harveyslash [email protected] íàïèñàë(à):

but isnt this version old ?


Reply to this email directly or view it on GitHub.

@harveyslash
Copy link

it runs on my physical nokia x.
it just doesnt run on the emulator.
it runs on bluestacks too.

so, should i be concerned about it not running on other physical devices ?

@suntehnik
Copy link
Collaborator

Because Genymotion use x86 architecture and mupdf was not compiled for that.
Use emulator bundled with android sdk.

16 èþíÿ 2014 ã., â 11:42, harveyslash [email protected] íàïèñàë(à):

it runs on my physical nokia x.
it just doesnt run on the emulator.


Reply to this email directly or view it on GitHub.

@harveyslash
Copy link

another thing i just found out, I get ExceptionInitializerError if i run the mupdf source as a library project.
error is, could not load mupdf , findlib returned null.
could you please help ?

@suntehnik
Copy link
Collaborator

Check you have .so in final APK file. Just unzip it as ordinary zip file and check libs folder inside.
I’m not sure you can use original MuPDF as a library project. You guess must copy libs manually.

16 èþíÿ 2014 ã., â 13:31, harveyslash [email protected] íàïèñàë(à):

another thing i just found out, I get ExceptionInitializerError if i run the mupdf source as a library project.
error is, could not load mupdf , findlib returned null.
could you please help ?


Reply to this email directly or view it on GitHub.

@harveyslash
Copy link

i did that, still same error

@bagusflyer
Copy link
Author

That’s because the c jnl interface has been changed. You can change the name of the functions. (Sorry, I don’t have the source code with me now. I can’t tell you the exact name of the function.)

在 2014年6月19日,下午07:34,harveyslash [email protected] 写道:

i did that, still same error


Reply to this email directly or view it on GitHub.

@tejalpandya
Copy link

I m using mupdf library for pdf reader writer. but problem is that its not got highlighted text in lolipop version. so can u suggest which library is latest? Give me reply.

@intrications
Copy link
Collaborator

@tejalpandya

I have no idea. The MuPDF java code was embedded in the app and altered so updating the MuPDF library is probably more complicated than just updating MuPDF.

There are open issues to update the MuPDF library used in the app and to make sure it works on all supported versions of Android.

#277 #281

@tejalpandya
Copy link

can u give me mupdf 1.7 latest version link ?

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