问题描述
我一直在努力,包括的tesseract库到我的Android项目今天。
I have been trying to include Tesseract libraries into my Android project today.
这是我发现我做了以下内容:
From what I have found I did following:
1)下载苔丝个从gooogle混帐,2)建立与NDK3)把* .so文件(armeabi / V7,X86,MIPS)成/应用/主/ jniLibs /,4)包*。所以到.jar文件,把归档到应用程序/库/写下了依赖{}给它gradle.build文件
1) Download tess-two from gooogle git, 2) build with NDK3) put *.so files (armeabi/v7,x86,mips) into /app/main/jniLibs/, 4) pack *.so into .jar file, put archive into app/libs/ and wrote dependency {} to it in gradle.build file
我使用Android的工作室,当我写TessBaseAPI和命中Alt + Enter键 - >添加依赖苔丝个模块,它automaticaly写输入行:
I'm using Android Studio and when I write TessBaseAPI and hit Alt+Enter -> "add dependency to tess-two module" it automaticaly write import row:
进口com.google code.tesseract.android.TessBaseAPI;
import com.googlecode.tesseract.android.TessBaseAPI;
但后来当我尝试建立它我得到
But then when I try to build it I'm getting
错误:包com.google code.tesseract.android不存在
"error: package com.googlecode.tesseract.android does not exist"
我使用的是Android 1.1工作室
谢谢你的答案!
I'm using Android Studio 1.1
Thanks for answers!
推荐答案
如果有人会疑惑,从ALT明显依赖+输入没有作出正确选择。
If somebody would wondering, obviously dependency from alt+enter didn't make it right.
它必须首先构建整个项目本身。所以我增加了一个文件夹:
It had to build whole project itself first. So I added a folder:
- 在包括':库:苔丝个
进入gradle.settings,移动苔丝个结构的整个项目到库/苔丝二'(当'图书馆'是同一级别的应用程序文件夹)。
into the gradle.settings, moving whole project of tess-two structure into 'libraries/tess-two' (when 'libraries' is same level as your 'app' folder).
这之后(如果您已经设置了 ndk.dir = C:路径local.properties),您可以将的模块依赖的到您的主项目...
After that (if you have set up ndk.dir=C:path in local.properties) , you are able to set module dependency into your main project...
单击鼠标右键的 APP->打开模块设置的(或F4),然后单击加右侧,并添加苔丝二是在项目中的应用程序模块。
Rightclick app->Open Module Settings(or F4) and click plus on right side and add tess-two as module in your project app.
请注意,苔丝个'文件夹必须包含自己的 build.gradle (manifestfile和project.properties)文件,因此它可以构建自己。
Notice that 'tess-two' folder has to contains own build.gradle (manifestfile and project.properties) file, so it can build itself.
希望这将帮助别人:)
这篇关于包括*。所以图书馆的Android工作室苔丝二(的tesseract)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!