title: Could not initialize Tesseract API with language=eng
body: <p>I am working on an Android app that requires OCR. I have decided to use <a href="https://github.com/rmtheis/tess-two" rel="noreferrer">Tesseract</a> as API but I keep on getting this error:</p>
  
  <blockquote>
    <p>E/Tesseract(native): Could not initialize Tesseract API with language=eng!</p>
  </blockquote>
  
  <ol>
  <li>I have already copied file <code>"eng.traineddata"</code> to the location.</li>
  <li>I am using Android Studio 2.1.2 (SDK 23)</li>
  <li>Testing on device with API 22 Android Lollipop 5.1.1 (Read about Permission issue on Marshmallow) </li>
  </ol>
  
  <p>Here is the code I am using:</p>
  
  <pre><code>public void reads(View view) {
  
    TextView textView = (TextView) findViewById(R.id.textView);
  
    int rotation = 0;
  
    try {
      ExifInterface exifInterface = new ExifInterface(mCurrentPhotoPath);
      int orientation = exifInterface.getAttributeInt(ExifInterface.TAG_ORIENTATION,ExifInterface.ORIENTATION_NORMAL);
  
      switch (orientation){
        case ExifInterface.ORIENTATION_ROTATE_90: rotation = 90; break;
        case ExifInterface.ORIENTATION_ROTATE_180: rotation = 180; break;
        case ExifInterface.ORIENTATION_ROTATE_270: rotation = 270; break;
      }
    } catch(Exception e) {
  
    }
  
    int w = imageBitmap.getWidth();
    int h = imageBitmap.getHeight();
  
    if (rotation != 0) {
      Matrix matrix = new Matrix();
      matrix.preRotate(rotation);
  
      imageBitmap = Bitmap.createBitmap(imageBitmap,0,0,w,h,matrix,false);
    } else {
      imageBitmap = Bitmap.createBitmap(imageBitmap,0,0,w,h);
    }
  
    imageBitmap = imageBitmap.copy(Bitmap.Config.ARGB_8888,true);
  
    TessBaseAPI ReadIt = new TessBaseAPI();
    ReadIt.init("/storage/emulated/0/","eng");
    ReadIt.setImage(imageBitmap);
  
    String Text = ReadIt.getUTF8Text();
  
    if (Text!=null) textView.setText(Text);
  
  }
  </code></pre>
  
  <p>I have used this line in my build.gradle dependency:</p>
  
  <blockquote>
    <p>compile 'com.rmtheis:tess-two:6.0.2'  </p>
  </blockquote>
  
  <p>also, I have copied the"<code>eng.traineddata</code> in the folder named <strong>tessdata</strong> directly by downloading in the particular stated directory.</p>