Gradle在干净的构建上显示错误消息,没有明确的解释

时间:2017-06-27 06:56:39

标签: android gradle android-gradle

App构建并成功运行,但在clean build(非增量)gradle上显示错误消息,无需进一步说明。

Android Studio版本 - 2.3.3
Gradle版本 - 2.3.3
Retro Lambda - 3.6.1

屏幕截图如下:

Gradle Error message screen shot

Project Gradle文件

buildscript {
    ext.kotlin_version = '1.1.3'
    ext.anko_version = '0.10.1'
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
        classpath 'me.tatarka:gradle-retrolambda:3.6.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

App Gradle文件

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'me.tatarka.retrolambda'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.3"
    defaultConfig {
        applicationId "com.example.project"
        minSdkVersion 17
        targetSdkVersion 25
        versionCode 15
        versionName "3.0.1"
        testInstrumentationRunner 
"android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'),         'proguard-rules.pro'
    }
}
sourceSets {
    main {
        res.srcDirs = [
                'src/main/res/layout/member_list2',
                'src/main/res/layout/pattern_lock',
                'src/main/res/layout/alter',
                'src/main/res/layout/member_details',
                'src/main/res/layout/maturity_browser',
                'src/main/res/layout/mpc_manager',
                'src/main/res/layout/settings',
                'src/main/res/layout/new_member_account_attached_rcv',
                'src/main/res/layout/maturity',
                'src/main/res/layout/deposit_browser',
                'src/main/res/layout/employee',
                'src/main/res/layout/manager',
                'src/main/res/layout/deposit',
                'src/main/res/layout/controls',
                'src/main/res/layout/image_processing',
                'src/main/res/layout/selectors',
                'src/main/res/layout/zone',
                'src/main/res/layout/new_account',
                'src/main/res/layout/sync',
                'src/main/res/layout/row_views',
                'src/main/res/layout/members',
                'src/main/res/layout/main',
                'src/main/res/layout',
                'src/main/res'

            ]
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2',  
{
        exclude group: 'com.android.support', module: 'support-annotations'
    })

compile project(':sqlite-android-3170000')
//compile 'com.theartofdev.edmodo:android-image-cropper:2.3.1'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
//compile 'com.android.support:palette-v7:25.3.1'
compile 'com.github.michaelye.easydialog:easydialog:1.4'
compile 'com.theartofdev.edmodo:android-image-cropper:2.4.4'
compile 'com.google.android.gms:play-services-vision:10.2.6'
compile 'com.sothree.slidinguppanel:library:3.3.1'
compile 'it.sephiroth.android.library.bottomnavigation:bottom-navigation:2.0.1-rc1'
compile 'me.zhanghai.android.patternlock:library:2.1.2'
compile 'me.dm7.barcodescanner:zxing:1.9.2'
//compile 'joda-time:joda-time:2.9.9'
testCompile 'junit:junit:4.12'
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"

// Anko Layouts
compile "org.jetbrains.anko:anko-sdk25:$anko_version" // sdk15, sdk19, sdk21, sdk23 are also available
compile "org.jetbrains.anko:anko-appcompat-v7:$anko_version"
// Coroutine listeners for Anko Layouts
compile "org.jetbrains.anko:anko-sdk25-coroutines:$anko_version"
compile "org.jetbrains.anko:anko-appcompat-v7-coroutines:$anko_version"
}
repositories {
    mavenCentral()
}  

注意:几天后突然出现错误消息且我的gradle文件未更改

1 个答案:

答案 0 :(得分:0)

在布局文件中使用已退役的线性布局来定义线性布局的方向,转到布局文件和设置方向,如

android:orientation = "vertical"

根据您的要求设定您的方向。