Hello, i got a fatal exception, when i tried to open a pdf file. I'm using the latest NDK Rev. 10b. Can you help me? What NDK Revision should i use? java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "rand" referenced by "libmupdf.so"... at java.lang.Runtime.loadLibrary(Runtime.java:364) at java.lang.System.loadLibrary(System.java:526) at com.artifex.mupdfdemo.MuPDFCore.<clinit>(MuPDFCore.java:14) at com.artifex.mupdfdemo.MuPDFActivity.openFile(MuPDFActivity.java:214) at com.artifex.mupdfdemo.MuPDFActivity.onCreate(MuPDFActivity.java:320) at android.app.Activity.performCreate(Activity.java:5231) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233) at android.app.ActivityThread.access$800(ActivityThread.java:135) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5001) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601) at dalvik.system.NativeStart.main(Native Method)
I have also tried NDK Rev.10 and Rev. 9d. Same exception appeared.
I have just built MuPDF on a clean install with SDK 23.0.2 and NDK 10b on Linux. I installed Android SDK Platform-tools 20 and Android SDK Build-tools 20. I installed SDK Platform 18 (4.3, API 18) and the ARM EABI v7a System Image 18. I set up an emulator image for Android 4.3. "ndk-build" finished as expected. "ant debug" finished as expected. "ant debug install" on the emulator, works as expected. "ant debug install" on my nexus 10 hardware, works as expected. No errors anywhere. Are you building on Linux or Windows? Are you using Eclipse or any other unsupported build system? We only support using the plain SDK and NDK command line tools.
Hi, I'm using Mac OS Mavericks. I followed the steps here http://www.mupdf.com/docs/how-to-build-mupdf-for-android. I used ndk and ant in terminal only (no ide for build). I was also in the irc support chat yesterday and one developer told me to try NDK Rev. 8c. NDK Rev. 8c works now. I also tried 10b, 10, and 9d without success. 8c is running.
The app started on my device. When i opened a pdf file, then the crash happened. But with NDK 8c its running wihtout problems.. I dont know why its running on Linux but not on Mac
(In reply to Paul from comment #3) > I'm using Mac OS Mavericks. I followed the steps here > http://www.mupdf.com/docs/how-to-build-mupdf-for-android. I used ndk and ant > in terminal only (no ide for build). I was also in the irc support chat > yesterday and one developer told me to try NDK Rev. 8c. NDK Rev. 8c works > now. I also tried 10b, 10, and 9d without success. 8c is running. Paul, can you give us the exact download link you used for your version of the ndk please? (for versions 10b, 10 and 9d). Thanks.
Yes, here it is. http://dl.google.com/android/ndk/android-ndk64-r10b-darwin-x86_64.tar.bz2 (10b) http://dl.google.com/android/ndk/android-ndk64-r10-darwin-x86_64.tar.bz2 (10) A colleague gave me 9d for Mac. I didnt download it.
You need to use the 32-bit NDK (android-ndk32-r10b-darwin-x86_64) if building for 32-bit targets. In the ARM headers in the 32-bit target NDK, rand() is declared as a static inline function (and as such does not need to exist as a symbol in libc.so on ARM devices). In the ARM headers in the 64-bit target NDK, rand() is declared as a regular function, but since it does not exist in the libc.so on ARM devices, there is a runtime error. Ergo, use the 32-bit target NDK when targeting 32-bit platforms. Or tell Google that their shit is broken.
*** Bug 695381 has been marked as a duplicate of this bug. ***
Ok, thank you. I'll take the 32-Bit version.