在android studio中构建失败

5 android gradle android-studio build.gradle

当我在线学习时,我收到此错误.

Error:Gradle: 
FAILURE: Build failed with an exception.

* What went wrong:
Task 'testClasses' not found in project ':ProwessPride_V1.01'.

* Try:
Run gradle tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Run Code Online (Sandbox Code Playgroud)

其中ProwessPride_V1.01是我在项目中包含的jar文件.

我在工作室中无效缓存/重新启动.重建和清理项目也,但我无法解决此错误.所以请帮助我如何解决它.

的build.gradle

     apply plugin: 'com.android.application'

        android {
            compileSdkVersion 23
            buildToolsVersion "23.0.0"

            defaultConfig {
                applicationId "com.example.technopits.dcn"
                minSdkVersion 17
                targetSdkVersion 23
                versionCode 1
                versionName "1.0"
            }
            buildTypes {
                release {
                    minifyEnabled false
                    proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
                }
            }
        }

        dependencies {
            compile fileTree(include: ['*.jar'], dir: 'libs')
            compile 'com.android.support:appcompat-v7:23.0.0'
            compile 'com.android.support:recyclerview-v7:23.0.0'
            compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
            compile 'com.google.android.gms:play-services-gcm:7.3.0'
            compile project(':ProwessPride_V1.01')
        }
Run Code Online (Sandbox Code Playgroud)

buil.gradle项目

//顶级构建文件,您可以在其中添加所有子项目/模块共有的配置选项.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.3.0'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}
Run Code Online (Sandbox Code Playgroud)

Gab*_*tti 1

定义compile project(':ProwessPride_V1.01'),gradle 正在搜索 .gradle文件中同名的项目settings.gradle

因为它是一个罐子,所以是错误的。

只需删除此行即可。

compile project(':ProwessPride_V1.01')
Run Code Online (Sandbox Code Playgroud)

如果您将 jar 添加到 libs 文件夹中,这一行就足够了。

compile fileTree(include: ['*.jar'], dir: 'libs')
Run Code Online (Sandbox Code Playgroud)