0

我正在尝试将 tessearct 用于基于图像的编译器应用程序。我在主项目下创建了一个库,其中包含 tess-two 和 eye-two 文件。我在构建build.gradle文件时遇到问题

项目的根build.gradle文件

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()
}

} 

项目的模块: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')
 }

现在项目的setting.gradle

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

tess-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"]

  }

眼睛-两个 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"]

    }

现在,当我构建它时,Android Studio 会抛出一个错误:

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

这真的让我无处可去,任何人都可以帮我解决这个问题,因为我一天就提交了!请。还与build.gradle文件有关 t o eyes-to 和 tess-two 在此先谢谢您。

4

1 回答 1

0

将以下行添加到您的 settings.gradle 文件

project(':tess-two').projectDir = new File('libraries/tess-two') 
project(':eyes-two').projectDir = new File('libraries/eyes-two') 
于 2016-05-01T22:01:01.750 回答