我正在尝试编译tesseract ocr库。最后一步是ant编译。但是关于找不到像这样的符号有错误
{
"first": {
"second" : "A"
},
"array": [
{
"name" : "AAA",
"something": {
"hola": "hi",
"NEW_PROPERTY": "AAA"
}
},
{
"name" : "BBB",
"something": {
"hola": "hi",
"NEW_PROPERTY": "BBB"
}
}
]
}
我的build.xml文件
PS C:\Users\-GT-\Desktop\proje\compiling20.09\tess-two-master\tess-two> ant release
Buildfile: C:\Users\-GT-\Desktop\proje\compiling20.09\tess-two-master\tess-two\build.xml
-set-mode-check:
-set-release-mode:
-release-obfuscation-check:
[echo] proguard.config is ${proguard.config}
-pre-build:
-check-env:
[checkenv] Android SDK Tools Revision 25.2.5
[checkenv] Installed at C:\android sdk
-setup:
[echo] Project Name: tess-two
[gettype] Project Type: Android Library
-build-setup:
[getbuildtools] Using latest Build Tools: 21.1.2
[echo] Resolving Build Target for tess-two...
[gettarget] Project Target: Android 4.4.2
[gettarget] API level: 19
[echo] ----------
[echo] Creating output directories if needed...
[mkdir] Created dir: C:\Users\-GT-\Desktop\proje\compiling20.09\tess-two-master\tess-two\bin\rsObj
[mkdir] Created dir: C:\Users\-GT-\Desktop\proje\compiling20.09\tess-two-master\tess-two\bin\rsLibs
[echo] ----------
[echo] Resolving Dependencies for tess-two...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency]
[dependency] ------------------
[echo] ----------
[echo] Building Libraries with 'release'...
[subant] No sub-builds to iterate on
-code-gen:
[mergemanifest] Found Deleted Target File
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[echo] ----------
[echo] Handling Resources...
[aapt] Found new input file
[aapt] Generating resource IDs...
[aapt] (skipping file '.gitkeep' due to ANDROID_AAPT_IGNORE pattern '.*')
[echo] ----------
[echo] Handling BuildConfig class...
[buildconfig] Generating BuildConfig class.
-pre-compile:
-compile:
[javac] Compiling 24 source files to C:\Users\-GT-\Desktop\proje\compiling20.09\tess-two-master\tess-two\bin\classes
[javac] warning: [options] source value 1.5 is obsolete and will be removed in a future release
[javac] warning: [options] target value 1.5 is obsolete and will be removed in a future release
[javac] warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
[javac] C:\Users\-GT-\Desktop\proje\compiling20.09\tess-two-master\tess-two\src\com\googlecode\leptonica\android\Pix.java:20: error: package android.support.annotation does not exist
[javac] import android.support.annotation.ColorInt;
[javac] ^
[javac] C:\Users\-GT-\Desktop\proje\compiling20.09\tess-two-master\tess-two\src\com\googlecode\leptonica\android\Pix.java:21: error: package android.support.annotation does not exist
[javac] import android.support.annotation.Size;
[javac] ^
[javac] C:\Users\-GT-\Desktop\proje\compiling20.09\tess-two-master\tess-two\src\com\googlecode\leptonica\android\Binarize.java:19: error: package android.support.annotation does not exist
[javac] import android.support.annotation.FloatRange;
[javac] ^
[javac] C:\Users\-GT-\Desktop\proje\compiling20.09\tess-two-master\tess-two\src\com\googlecode\leptonica\android\Box.java:20: error: package android.support.annotation does not exist
[javac] import android.support.annotation.Size;
[javac] ^
[javac] C:\Users\-GT-\Desktop\proje\compiling20.09\tess-two-master\tess-two\src\com\googlecode\leptonica\android\Boxa.java:20: error: package android.support.annotation does not exist
[javac] import android.support.annotation.Size;
[javac] ^
[javac] C:\Users\-GT-\Desktop\proje\compiling20.09\tess-two-master\tess-two\src\com\googlecode\leptonica\android\Constants.java:19: error: package android.support.annotation does not exist
[javac] import android.support.annotation.IntDef;
[javac] ^
[javac] C:\Users\-GT-\Desktop\proje\compiling20.09\tess-two-master\tess-two\src\com\googlecode\leptonica\android\Constants.java:56: error: cannot find symbol
[javac] @IntDef({L_INSERT, L_COPY, L_CLONE})
[javac] ^
[javac] symbol: class IntDef
[javac] location: class Constants
[javac] C:\Users\-GT-\Desktop\proje\compiling20.09\tess-two-master\tess-two\src\com\googlecode\leptonica\android\Constants.java:79: error: cannot find symbol
[javac] @IntDef({L_SORT_INCREASING, L_SORT_DECREASING})
[javac] ^
[javac] symbol: class IntDef
[javac] location: class Constants
[javac] C:\Users\-GT-\Desktop\proje\compiling20.09\tess-two-master\tess-two\src\com\googlecode\leptonica\android\Constants.java:89: error: cannot find symbol
[javac] @IntDef({L_SORT_BY_X, L_SORT_BY_Y, L_SORT_BY_WIDTH, L_SORT_BY_HEIGHT, L_SORT_BY_MIN_DIMENSION,
[javac] ^
[javac] symbol: class IntDef
[javac] location: class Constants
[javac] C:\Users\-GT-\Desktop\proje\compiling20.09\tess-two-master\tess-two\src\com\googlecode\leptonica\android\Edge.java:19: error: package android.support.annotation does not exist
[javac] import android.support.annotation.IntDef;
[javac] ^
[javac] C:\Users\-GT-\Desktop\proje\compiling20.09\tess-two-master\tess-two\src\com\googlecode\leptonica\android\Edge.java:38: error: cannot find symbol
[javac] @IntDef({L_HORIZONTAL_EDGES, L_VERTICAL_EDGES, L_ALL_EDGES})
[javac] ^
[javac] symbol: class IntDef
[javac] location: class Edge
[javac] C:\Users\-GT-\Desktop\proje\compiling20.09\tess-two-master\tess-two\src\com\googlecode\leptonica\android\JpegIO.java:21: error: package android.support.annotation does not exist
[javac] import android.support.annotation.IntRange;
[javac] ^
[javac] C:\Users\-GT-\Desktop\proje\compiling20.09\tess-two-master\tess-two\src\com\googlecode\leptonica\android\MorphApp.java:19: error: package android.support.annotation does not exist
[javac] import android.support.annotation.IntDef;
[javac] ^
[javac] C:\Users\-GT-\Desktop\proje\compiling20.09\tess-two-master\tess-two\src\com\googlecode\leptonica\android\MorphApp.java:38: error: cannot find symbol
[javac] @IntDef({L_TOPHAT_BLACK, L_TOPHAT_WHITE})
[javac] ^
[javac] symbol: class IntDef
[javac] location: class MorphApp
[javac] C:\Users\-GT-\Desktop\proje\compiling20.09\tess-two-master\tess-two\src\com\googlecode\leptonica\android\Pixa.java:20: error: package android.support.annotation does not exist
[javac] import android.support.annotation.Size;
[javac] ^
[javac] C:\Users\-GT-\Desktop\proje\compiling20.09\tess-two-master\tess-two\src\com\googlecode\leptonica\android\Rotate.java:19: error: package android.support.annotation does not exist
[javac] import android.support.annotation.IntRange;
[javac] ^
[javac] C:\Users\-GT-\Desktop\proje\compiling20.09\tess-two-master\tess-two\src\com\googlecode\tesseract\android\TessBaseAPI.java:22: error: package android.support.annotation does not exist
[javac] import android.support.annotation.IntDef;
[javac] ^
[javac] C:\Users\-GT-\Desktop\proje\compiling20.09\tess-two-master\tess-two\src\com\googlecode\tesseract\android\TessBaseAPI.java:23: error: package android.support.annotation does not exist
[javac] import android.support.annotation.WorkerThread;
[javac] ^
[javac] C:\Users\-GT-\Desktop\proje\compiling20.09\tess-two-master\tess-two\src\com\googlecode\tesseract\android\TessBaseAPI.java:60: error: cannot find symbol
[javac] @IntDef({PSM_OSD_ONLY, PSM_AUTO_OSD, PSM_AUTO_ONLY, PSM_AUTO, PSM_SINGLE_COLUMN,
[javac] ^
[javac] symbol: class IntDef
[javac] location: class PageSegMode
[javac] C:\Users\-GT-\Desktop\proje\compiling20.09\tess-two-master\tess-two\src\com\googlecode\tesseract\android\TessBaseAPI.java:124: error: cannot find symbol
[javac] @IntDef({OEM_TESSERACT_ONLY, OEM_CUBE_ONLY, OEM_TESSERACT_CUBE_COMBINED, OEM_DEFAULT})
[javac] ^
[javac] symbol: class IntDef
[javac] location: class TessBaseAPI
[javac] C:\Users\-GT-\Desktop\proje\compiling20.09\tess-two-master\tess-two\src\com\googlecode\tesseract\android\TessBaseAPI.java:151: error: cannot find symbol
[javac] @IntDef({RIL_BLOCK, RIL_PARA, RIL_TEXTLINE, RIL_WORD, RIL_SYMBOL})
[javac] ^
[javac] symbol: class IntDef
[javac] location: class PageIteratorLevel
[javac] C:\Users\-GT-\Desktop\proje\compiling20.09\tess-two-master\tess-two\src\com\googlecode\leptonica\android\Pix.java:130: error: cannot find symbol
[javac] public boolean getDimensions(@Size(min=3) int[] dimensions) {
[javac] ^
[javac] symbol: class Size
[javac] location: class Pix
[javac] C:\Users\-GT-\Desktop\proje\compiling20.09\tess-two-master\tess-two\src\com\googlecode\leptonica\android\Pix.java:302: error: cannot find symbol
[javac] public void setPixel(int x, int y, @ColorInt int color) {
[javac] ^
[javac] symbol: class ColorInt
[javac] location: class Pix
[javac] C:\Users\-GT-\Desktop\proje\compiling20.09\tess-two-master\tess-two\src\com\googlecode\leptonica\android\Binarize.java:124: error: cannot find symbol
[javac] @FloatRange(from=0.0, to=1.0) float scoreFraction) {
[javac] ^
[javac] symbol: class FloatRange
[javac] location: class Binarize
[javac] C:\Users\-GT-\Desktop\proje\compiling20.09\tess-two-master\tess-two\src\com\googlecode\leptonica\android\Binarize.java:190: error: cannot find symbol
[javac] public static Pix sauvolaBinarizeTiled(Pix pixs, int whsize, @FloatRange(from=0.0) float factor,
[javac] ^
[javac] symbol: class FloatRange
[javac] location: class Binarize
[javac] C:\Users\-GT-\Desktop\proje\compiling20.09\tess-two-master\tess-two\src\com\googlecode\leptonica\android\Box.java:190: error: cannot find symbol
[javac] public boolean getGeometry(@Size(min=4) int[] geometry) {
[javac] ^
[javac] symbol: class Size
[javac] location: class Box
[javac] C:\Users\-GT-\Desktop\proje\compiling20.09\tess-two-master\tess-two\src\com\googlecode\leptonica\android\Boxa.java:121: error: cannot find symbol
[javac] public boolean getGeometry(int index, @Size(min=4) int[] geometry) {
[javac] ^
[javac] symbol: class Size
[javac] location: class Boxa
[javac] C:\Users\-GT-\Desktop\proje\compiling20.09\tess-two-master\tess-two\src\com\googlecode\leptonica\android\JpegIO.java:64: error: cannot find symbol
[javac] public static byte[] compressToJpeg(Pix pixs, @IntRange(from=0, to=100) int quality,
[javac] ^
[javac] symbol: class IntRange
[javac] location: class JpegIO
[javac] C:\Users\-GT-\Desktop\proje\compiling20.09\tess-two-master\tess-two\src\com\googlecode\leptonica\android\Pixa.java:359: error: cannot find symbol
[javac] public boolean getBoxGeometry(int index, @Size(min=4) int[] dimensions) {
[javac] ^
[javac] symbol: class Size
[javac] location: class Pixa
[javac] C:\Users\-GT-\Desktop\proje\compiling20.09\tess-two-master\tess-two\src\com\googlecode\leptonica\android\Rotate.java:106: error: cannot find symbol
[javac] public static Pix rotateOrth(Pix pixs, @IntRange(from=0, to=3) int quads) {
[javac] ^
[javac] symbol: class IntRange
[javac] location: class Rotate
[javac] C:\Users\-GT-\Desktop\proje\compiling20.09\tess-two-master\tess-two\src\com\googlecode\tesseract\android\TessBaseAPI.java:519: error: cannot find symbol
[javac] @WorkerThread
[javac] ^
[javac] symbol: class WorkerThread
[javac] location: class TessBaseAPI
[javac] C:\Users\-GT-\Desktop\proje\compiling20.09\tess-two-master\tess-two\src\com\googlecode\tesseract\android\TessBaseAPI.java:544: error: cannot find symbol
[javac] @WorkerThread
[javac] ^
[javac] symbol: class WorkerThread
[javac] location: class TessBaseAPI
[javac] C:\Users\-GT-\Desktop\proje\compiling20.09\tess-two-master\tess-two\src\com\googlecode\tesseract\android\TessBaseAPI.java:567: error: cannot find symbol
[javac] @WorkerThread
[javac] ^
[javac] symbol: class WorkerThread
[javac] location: class TessBaseAPI
[javac] C:\Users\-GT-\Desktop\proje\compiling20.09\tess-two-master\tess-two\src\com\googlecode\tesseract\android\TessBaseAPI.java:588: error: cannot find symbol
[javac] @WorkerThread
[javac] ^
[javac] symbol: class WorkerThread
[javac] location: class TessBaseAPI
[javac] C:\Users\-GT-\Desktop\proje\compiling20.09\tess-two-master\tess-two\src\com\googlecode\tesseract\android\TessBaseAPI.java:604: error: cannot find symbol
[javac] @WorkerThread
[javac] ^
[javac] symbol: class WorkerThread
[javac] location: class TessBaseAPI
[javac] C:\Users\-GT-\Desktop\proje\compiling20.09\tess-two-master\tess-two\src\com\googlecode\tesseract\android\TessBaseAPI.java:764: error: cannot find symbol
[javac] @WorkerThread
[javac] ^
[javac] symbol: class WorkerThread
[javac] location: class TessBaseAPI
[javac] 36 errors
[javac] 3 warnings
BUILD FAILED
C:\android sdk\tools\ant\build.xml:716: The following error occurred while executing this line:
C:\android sdk\tools\ant\build.xml:730: Compile failed; see the compiler error output for details.
Total time: 2 seconds
我正在使用最新的apache ant版本。和android api 19. ndk版本是r7c 我该如何解决这个问题。我会在我的build.xml文件中添加javac编译文件夹来解决此问题吗?
感谢您的帮助