Integration issue to tess-two (Tesseract Tools for Android)library into an Android studio and build ndk
Asked Answered
R

1

14

I want to import tess-two library in android studio and after compilation it show error in ndk build. I have already tries solution given on stackoverflow. like , Execution failed for task ':app:compileDebugNdk' but it did not resolved my issue. please suggest me where i am doing wrong.

It show the following error :

Error:error: undefined reference to 'isnanf'

Error:error: undefined reference to '__isinff'
Error:error: undefined reference to 'isnanf'
[arm64-v8a] Install        : libtess.so => libs/arm64-v8a/libtess.so
Error:error: undefined reference to 'isnanf'
Error:error: undefined reference to '__isinff'
Error:error: undefined reference to 'isnanf'
[x86_64] Install        : libjpgt.so => libs/x86_64/libjpgt.so
Error:error: linker command failed with exit code 1 (use -v to see invocation)
Error:error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [obj/local/armeabi-v7a/libtess.so] Error 1

make: *** Waiting for unfinished jobs....
make: *** [obj/local/armeabi/libtess.so] Error 1
make: Leaving directory `D:/OCR/tess-two-master/tess-two-master/tess-two'
:tess-two:ndkBuild FAILED

Error:Execution failed for task ':tess-two:ndkBuild'.
Process 'command 'D:\SDK\sdk\ndk-bundle/ndk-build.cmd'' finished with non-zero exit value 2  
Roughage answered 17/3, 2016 at 9:41 Comment(5)
If you just want a working library, you can use the precompiled version (see "Usage" here) or build with NDK r10e.Skidmore
Thank u ,it has compiled with r10e.Roughage
Hi im using the same library in ubuntu, But i got this error Error:Execution failed for task ':tess-two:ndkBuild'. > A problem occurred starting process 'command 'ndk-build''. Please Help me ASAP.Thanks in Advance.Phone
@Skidmore Hello, Do you mean we just need to go to link and then clone tess-two and get a training file and create a new Android Studio project and just edit the app module's build.gradle file to add tess-two as an external dependency (by adding that single line)? Is this what you mean?Bahamas
First compile your tess-two library with ndk n then import as library.Roughage
S
11

It turns out that the root cause of this error is that NDK r11 doesn't support android-8 (Android 2.2.x), whereas NDK r10 did.

Changing the Application.mk file to use APP_PLATFORM := android-9 fixes this.

Skidmore answered 26/3, 2016 at 21:52 Comment(2)
Do you know where this change is documented?Unbridled
Actually, the NDK still includes android-3 as the earliest targetable platform. The reason that changing to android-9 works for isnan/isnanf is that precisely these symbols were removed from libm.so by this changeset: android.googlesource.com/platform/development/+/…Unbridled

© 2022 - 2024 — McMap. All rights reserved.