我的应用使用使用原生api的tess-two
(https://github.com/rmtheis/tess-two)库。当我使用单独的tess-two
或dropbox sync api
时,没有任何事情发生。但我的应用程序需要使用这两个库,当我同时添加两个库时,我得到dropbox sync api
这样的例外:
11-20 16:18:30.440: E/AndroidRuntime(7672): FATAL EXCEPTION: main
11-20 16:18:30.440: E/AndroidRuntime(7672): java.lang.ExceptionInInitializerError
11-20 16:18:30.440: E/AndroidRuntime(7672): at com.dropbox.sync.android.CoreAccountManager.initNativeLib(CoreAccountManager.java:155)
11-20 16:18:30.440: E/AndroidRuntime(7672): at com.dropbox.sync.android.CoreAccountManager.<init>(CoreAccountManager.java:126)
11-20 16:18:30.440: E/AndroidRuntime(7672): at com.dropbox.sync.android.DbxAccountManager.getInstance(DbxAccountManager.java:149)
11-20 16:18:30.440: E/AndroidRuntime(7672): at com.dropbox.sync.android.DbxAccountManager.getInstance(DbxAccountManager.java:115)
11-20 16:18:30.440: E/AndroidRuntime(7672): at com.appiphany.roboscanner.utils.Config.getDropboxAccountManager(Config.java:19)
11-20 16:18:30.440: E/AndroidRuntime(7672): at com.appiphany.roboscanner.DocumentListFragment.onAttach(DocumentListFragment.java:110)
11-20 16:18:30.440: E/AndroidRuntime(7672): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:883)
11-20 16:18:30.440: E/AndroidRuntime(7672): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1104)
11-20 16:18:30.440: E/AndroidRuntime(7672): at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:682)
11-20 16:18:30.440: E/AndroidRuntime(7672): at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1467)
11-20 16:18:30.440: E/AndroidRuntime(7672): at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:570)
11-20 16:18:30.440: E/AndroidRuntime(7672): at com.appiphany.roboscanner.BaseActivity.onStart(BaseActivity.java:28)
11-20 16:18:30.440: E/AndroidRuntime(7672): at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1167)
11-20 16:18:30.440: E/AndroidRuntime(7672): at android.app.Activity.performStart(Activity.java:5216)
11-20 16:18:30.440: E/AndroidRuntime(7672): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2073)
11-20 16:18:30.440: E/AndroidRuntime(7672): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2125)
11-20 16:18:30.440: E/AndroidRuntime(7672): at android.app.ActivityThread.access$600(ActivityThread.java:140)
11-20 16:18:30.440: E/AndroidRuntime(7672): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1227)
11-20 16:18:30.440: E/AndroidRuntime(7672): at android.os.Handler.dispatchMessage(Handler.java:99)
11-20 16:18:30.440: E/AndroidRuntime(7672): at android.os.Looper.loop(Looper.java:137)
11-20 16:18:30.440: E/AndroidRuntime(7672): at android.app.ActivityThread.main(ActivityThread.java:4898)
11-20 16:18:30.440: E/AndroidRuntime(7672): at java.lang.reflect.Method.invokeNative(Native Method)
11-20 16:18:30.440: E/AndroidRuntime(7672): at java.lang.reflect.Method.invoke(Method.java:511)
11-20 16:18:30.440: E/AndroidRuntime(7672): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
11-20 16:18:30.440: E/AndroidRuntime(7672): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
11-20 16:18:30.440: E/AndroidRuntime(7672): at dalvik.system.NativeStart.main(Native Method)
11-20 16:18:30.440: E/AndroidRuntime(7672): Caused by: java.lang.ExceptionInInitializerError
11-20 16:18:30.440: E/AndroidRuntime(7672): at com.dropbox.sync.android.NativeLib.<init>(NativeLib.java:33)
11-20 16:18:30.440: E/AndroidRuntime(7672): at com.dropbox.sync.android.NativeLib.<clinit>(NativeLib.java:11)
11-20 16:18:30.440: E/AndroidRuntime(7672): ... 26 more
11-20 16:18:30.440: E/AndroidRuntime(7672): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load DropboxSync: findLibrary returned null
11-20 16:18:30.440: E/AndroidRuntime(7672): at java.lang.Runtime.loadLibrary(Runtime.java:365)
11-20 16:18:30.440: E/AndroidRuntime(7672): at java.lang.System.loadLibrary(System.java:535)
11-20 16:18:30.440: E/AndroidRuntime(7672): at com.dropbox.sync.android.NativeHttp.<clinit>(NativeHttp.java:446)
我确信我已将dropbox sync api的所有.so和jar库文件复制到我的libs文件夹中。我也引用此链接Error in dropboxSync: findlibrary returned null,但它不起作用。
有什么想法吗?
更新:我的Android.mk的tess-two看起来像这样(我不会改变任何来自github源码,因为我认为两个库没有相互引用):
LOCAL_PATH := $(call my-dir)
TESSERACT_PATH := $(LOCAL_PATH)/com_googlecode_tesseract_android/src
LEPTONICA_PATH := $(LOCAL_PATH)/com_googlecode_leptonica_android/src
# Just build the Android.mk files in the subdirs
include $(call all-subdir-makefiles)
答案 0 :(得分:0)
将libDropboxSync.so从armeabi复制到armeabi-v7a文件夹解决了问题,但我不知道它是如何工作的。
更多详情来自dropbox 4rum的my own question