0

Iam trying to use tessearct for an image based compiler App. I have created a library under the main project which contains both tess-two and eyes-two files. Iam having problems in building their build.gradle files

THE PROJECT'S Root build.gradle file

enter // Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:1.2.3'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
    }
}

allprojects {
repositories {
    jcenter()
}

} 

The project's module:app/build.gradle

apply plugin: 'com.android.application'

android {
compileSdkVersion 22
buildToolsVersion "23.0.0 rc3"

defaultConfig {
    applicationId "com.example.pavithra.ocrreader"
    minSdkVersion 15
    targetSdkVersion 22
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
  }
 }

 dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.1'
compile project (':libraries:eyes-two')
compile project (':libraries:tess-two')
 }

now the project's setting.gradle

  include ':app'
  include ':libraries:eyes-two'
  include ':libraries:tess-two'

tess-two's build.gradle

   buildscript {

   repositories {

       mavenCentral()
    }

   dependencies {

       classpath "com.android.tools.build:gradle:1.2.3"

    }

  }


 apply plugin: "android-library"

  android {

   compileSdkVersion 22

   buildToolsVersion '23.0.0 rc3'

  defaultConfig {

     minSdkVersion 15
     targetSdkVersion 22
  }

  sourceSets.main {
      manifest.srcFile "AndroidManifest.xml"

    java.srcDirs = ["src"]
    resources.srcDirs = ["src"]
    res.srcDirs = ["res"]
    jniLibs.srcDirs = ["libs"]

  }

eyes-two build.gradle

   buildscript {

   repositories {

       mavenCentral()
  }

   dependencies {

     classpath "com.android.tools.build:gradle:1.2.3"

      }

   }


   apply plugin: "android-library"

    android {

   compileSdkVersion 22

   buildToolsVersion '23.0.0 rc3'

     defaultConfig {

     minSdkVersion 15
     targetSdkVersion 22
     }

    sourceSets.main {
       manifest.srcFile "AndroidManifest.xml"

       java.srcDirs = ["src"]
       resources.srcDirs = ["src"]
       res.srcDirs = ["res"]
       jniLibs.srcDirs = ["libs"]

    }

Now when i build this, Android studio throws an error saying:

Error:A problem occurred configuring project ':app'.
 > Cannot evaluate module eyes-two : Configuration with name 'default' not found.

This is really taking me no where Can anyone PLEASE HELP me with it as i have my submission in a day ! please. Also with the build.gradle files with respect to eyes-to and tess-two Thank you in advance.

  • @rmtheis i got it from here https://coderwall.com/p/eurvaq/tesseract-with-andoird-and-gradle i followed their instructions to build the gradle files of tess-two and eyes-two. but i must say, u have done a brilliant work with tessearct :) could you please help me with the gradle files. thank you. – Pavithra Gunasekar Aug 06 '15 at 14:07

1 Answers1

0

Add the following lines to your settings.gradle file

project(':tess-two').projectDir = new File('libraries/tess-two') 
project(':eyes-two').projectDir = new File('libraries/eyes-two') 
Tunaki
  • 132,869
  • 46
  • 340
  • 423