Building tess-two into a project using Android Studio's gradle build

天大地大妈咪最大 提交于 2019-12-01 00:18:08
Dale

4. Configure Android Studio build for native functionality

4a. Link C++ Project with Gradle

First, check the tess-two project for build files. You may select CMakeLists.txt or Android.mk files. Both are currently supported.

In this case, I used ndk-build, which seemed like a good bet for integrating the native code.

For more information, see Android Studio documentation

4b. Manage Long Commands

In Windows, errors may be encountered if the command length grows too large. To prevent problems, use LOCAL_SHORT_COMMANDS AND APP_SHORT_COMMANDS in the Android.mk file.

The "e=87" error is what you are avoiding by doing this:

For more on that topic, see stackoverflow question about error 87.

4c. Add Module Dependency for tess-two

In File > Project Structure > Dependencies use the + to add the tess-two dependency:

4d. Build the Project and check .apk file for .so files

The build, which takes a long time, should complete now. Validate that the .apk file contains the .so files, created during the build. With the tess-two libraries in an static initializer, run the project on your Android device:

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!