2015-02-06 77 views
1

我已經下載了tess-two,然後我已將所有從該位置導入到我的項目中。編譯* .so文件,並嘗試在我的手機一樣,運行此:在手機上運行tess-2

TessBaseAPI baseApi = new TessBaseAPI(); 
    baseApi.setDebug(true); 
    baseApi.init(DATA_PATH, lang); 
    baseApi.setImage(bitmap); 
    String recognizedText = baseApi.getUTF8Text(); 
    baseApi.end(); 

,但結果是可悲的:

02-06 15:43:32.095 4072-4072/my.package.name E/AndroidRuntime? FATAL EXCEPTION: main 
Process: my.package.name, PID: 4072 
java.lang.UnsatisfiedLinkError: Native method not found: my.package.name.tesseract.android.TessBaseAPI.nativeClassInit:()V 
     at my.package.name.tesseract.android.TessBaseAPI.nativeClassInit(Native Method) 
     at my.package.name.tesseract.android.TessBaseAPI.<clinit>(TessBaseAPI.java:46) 
     at my.package.name.activities.SimpleAndroidOCRActivity.onPhotoTaken(SimpleAndroidOCRActivity.java:214) 
     at my.package.name.activities.SimpleAndroidOCRActivity.onActivityResult(SimpleAndroidOCRActivity.java:138) 
     at android.app.Activity.dispatchActivityResult(Activity.java:5441) 
     at android.app.ActivityThread.deliverResults(ActivityThread.java:3353) 
     at android.app.ActivityThread.handleSendResult(ActivityThread.java:3400) 
     at android.app.ActivityThread.access$1300(ActivityThread.java:141) 
     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1250) 
     at android.os.Handler.dispatchMessage(Handler.java:102) 
     at android.os.Looper.loop(Looper.java:136) 
     at android.app.ActivityThread.main(ActivityThread.java:5047) 
     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:806) 
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:622) 
     at dalvik.system.NativeStart.main(Native Method) 

任何一個可以幫助我解決這個問題呢?

+0

你解決了這個問題嗎?我有同樣的問題...這是不可能解決.... – Aspicas 2015-09-16 06:59:25

+0

@Aspicas是的,我做錯了包 – WOLVERINE 2015-09-16 07:41:01

+0

我有'* .so庫'文件夾'src/main/jniLibs'如何實現項目?你能幫我嗎?總是會報告相同的錯誤.... – Aspicas 2015-09-16 07:47:43

回答

0

你好我認爲你沒有編譯* .so文件匹配所有的CPU。

請編輯Application.mk如下

APP_STL:= gnustl_static
APP_ABI:= armeabi armeabi-V7A 86 MIPS arm64-x86_64的V8A MIPS64
APP_OPTIM:=釋放
APP_PLATFORM:= android- 9
APP_CPPFLAGS + = -fexceptions -frtti
NDK_TOOLCHAIN_VERSION:=鐺

然後編譯,最好的問候

相關問題