-2

I have Windows 8.1, Android Studio and NDK installed.

I am making an OCR android app and following this tutorial http://www.codeproject.com/Tips/840623/Android-Character-Recognition

I am facing a problem at building the project.

I updated my PATH in System Variables to

“C:\Program Files\Java\jdk1.8.0_25\bin;D:\Softwares\Studies\Android\android-sdk\tools;D:\Softwares\Studies\Android\android-ndk-r10d”

And then first I executed “ndk-build” command on DOS which executed successfully and then when I executed this command

“android update project --path D:\Softwares\Studies\Android\OCR\Code_Project\tess-two-master\tess-two”

I got this error:

“ `'xcopy' is not recognized as an internal or external command, operable program or batch file`.
Error: 

    The project either has no target set or the target is invalid.
    Please provide a --target to the 'android.bat update' command. 

”

I ve searched all over the internet but could not find the solution, can you please help me with this? Thanks

Amsheer
  • 7,046
  • 8
  • 47
  • 81
Aqarain
  • 82
  • 9
  • add tess lib in ur app – ATRS Feb 20 '15 at 07:06
  • @ATRS can you please elaborate? – Aqarain Feb 20 '15 at 08:11
  • first import tess-two project and right click go to properties- select the builders and create the new builder 1) Location:set ur ndk location path 2)working dirctory:tess-two project. – ATRS Feb 20 '15 at 09:45
  • Have you checked the answers to these similar questions? http://stackoverflow.com/questions/5407479/sdk-manager-does-not-find-java http://stackoverflow.com/questions/17511756/android-sdk-manager-shows-xcopy-is-not-recognized-while-updating-project – rmtheis Feb 20 '15 at 15:22
  • @rmtheis Thank God you saw this post. I have tried every method now, I am able to solve xcopy part but the error part is still the same **Error: The project either has no target set or the target is invalid. Please provide a --target to the 'android.bat update' command.** I am using this command: **android update project --path D:\Softwares\Studies\Android\OCR\Code_Project\tess-two-master\tess-two** – Aqarain Feb 20 '15 at 16:37
  • Glad it worked. You should post your solution to your first question as an answer (to help others), and post your second question as a new StackOverflow question. – rmtheis Feb 20 '15 at 16:43
  • @rmtheis i simply copied xcopy from System32 to my SDK/tools folder but the error is the same. How can i remove this? – Aqarain Feb 20 '15 at 16:47
  • No, that's a different error. It no longer mentions xcopy. You should post your solution as an answer and ask a new question. – rmtheis Feb 21 '15 at 03:04
  • @rmtheis Firstly I am new here and I have reached the limit of asking any more questions so I cant ask secondly the error remains the same, it didn't solve at all and if you really know the ans why cant you answer it here? I ll post the whole solution afterwards. So please if you know the ans, ans it. Thanks – Aqarain Feb 21 '15 at 03:51
  • Does the error still say `'xcopy' is not recognized as an internal or external command`? – rmtheis Feb 21 '15 at 05:03

2 Answers2

1

I have searched the whole internet and could not find a single place where the proper ans is given. This had basically two parts:

i) "xcopy" is not recognized

ii) The project either has no target set or the target is invalid. Please provide a --target to the 'android.bat update' command.

The first part part can be solved by any of the two ways:

i) Moving xcopy.exe file from Windows/System32 folder to android-sdk\tools folder OR

ii) Adding %SystemRoot%\system32 to PATH in System Variables in Environment Variables. The PATH must contain android-sdk\tools;android-ndk-r10d;%SystemRoot%\system32 at least.

Now comes the second part. Enter this command: android update project --path (location of tess-two folder) --target android-19 (19 is the API level here and may vary)

for e.g. android update project --path D:\Softwares\Studies\Android\OCR\Code_Project\tess-two-master\tess-two --target android-19

THAT'S IT. Hope it is clear even to someone who is very new. :)

Ps. If you find it useful, please do vote up, I am new and need reputations. :)

Aqarain
  • 82
  • 9
-1

This blogpost has a elaborate description on how to build tesseract on Windows using Eclipse.

botteaap
  • 5,790
  • 3
  • 29
  • 35
ATRS
  • 247
  • 4
  • 15