還有就是我使用的項目:http://code.google.com/p/droidreader/加載我的圖書館
,當我嘗試運行我的項目,我得到了加載我的圖書館「pdfrender」 這裏的問題是線路問題引起:System.loadLibrary("pdfrender");
在我的項目,我有一個名爲floader JNI和包含庫pdfrender.c
這裏是我的logcat:
02-28 10:57:55.241: E/AndroidRuntime(596): java.lang.ExceptionInInitializerError
02-28 10:57:55.241: E/AndroidRuntime(596): at de.hilses.droidreader.DroidReaderActivity.onCreate(DroidReaderActivity.java:108)
02-28 10:57:55.241: E/AndroidRuntime(596): at android.app.Activity.performCreate(Activity.java:4465)
02-28 10:57:55.241: E/AndroidRuntime(596): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
02-28 10:57:55.241: E/AndroidRuntime(596): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
02-28 10:57:55.241: E/AndroidRuntime(596): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
02-28 10:57:55.241: E/AndroidRuntime(596): at android.app.ActivityThread.access$600(ActivityThread.java:123)
02-28 10:57:55.241: E/AndroidRuntime(596): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
02-28 10:57:55.241: E/AndroidRuntime(596): at android.os.Handler.dispatchMessage(Handler.java:99)
02-28 10:57:55.241: E/AndroidRuntime(596): at android.os.Looper.loop(Looper.java:137)
02-28 10:57:55.241: E/AndroidRuntime(596): at android.app.ActivityThread.main(ActivityThread.java:4424)
02-28 10:57:55.241: E/AndroidRuntime(596): at java.lang.reflect.Method.invokeNative(Native Method)
02-28 10:57:55.241: E/AndroidRuntime(596): at java.lang.reflect.Method.invoke(Method.java:511)
02-28 10:57:55.241: E/AndroidRuntime(596): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
02-28 10:57:55.241: E/AndroidRuntime(596): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
02-28 10:57:55.241: E/AndroidRuntime(596): at dalvik.system.NativeStart.main(Native Method)
02-28 10:57:55.241: E/AndroidRuntime(596): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load pdfrender: findLibrary returned null
02-28 10:57:55.241: E/AndroidRuntime(596): at java.lang.Runtime.loadLibrary(Runtime.java:365)
02-28 10:57:55.241: E/AndroidRuntime(596): at java.lang.System.loadLibrary(System.java:535)
02-28 10:57:55.241: E/AndroidRuntime(596): at de.hilses.droidreader.PdfRender.<clinit>(PdfRender.java:111)
02-28 10:57:55.241: E/AndroidRuntime(596): ... 15 more
請我新的Eclipse,我怎麼能做到這一點。我得到pdfrender.c在jni文件夾中!我知道如何導入.jar庫,而不是.c ?? – 2012-02-28 13:39:18
我一直在閱讀開源項目的自述文件,他們說,爲了構建DroidReader,您需要: - DroidReader的來源,但您已經管理好了...... - 源代碼MuPDF軟件/庫 - libjpeg的 的源代碼 - 的對FreeType2 源代碼 - Android原生開發套件(NDK) - 當然了Android SDK。 – 2012-02-28 15:26:29
,我沒有安裝任何名爲ndk的東西!也許是這樣? – 2012-02-28 15:27:01