错误构建gradle sdk版本

时间:2017-07-19 03:17:39

标签: android xml utf-8 sdk apk

构建apk时出错。

Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

已经检查stackoverflow但没有解决。这是我的构建gradle

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.3"
    defaultConfig {
        applicationId "com.mkit.crown"
        minSdkVersion 21
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        debug {
            debuggable true
        }
    }
}

ext {
    servicesLibVersion = '9.8.0'
    supportLibVersion = '25.0.0'
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile "com.google.android.gms:play-services-vision:${servicesLibVersion}"
    compile "com.android.support:appcompat-v7:${supportLibVersion}"
    compile "com.android.support:design:${supportLibVersion}"
    compile "com.toptoche.searchablespinner:searchablespinnerlibrary:1.3.1"
    compile "com.wdullaer:materialdatetimepicker:3.0.0"
    compile "com.andkulikov:transitionseverywhere:1.7.0"
    compile "com.android.support:multidex:1.0.0"
}

我的android sdk工具版本是26.0.0。 在构建gradle上它必须是相同的吗?我已经将25改为26但仍然收到错误信息

1 个答案:

答案 0 :(得分:0)

布局中显示错误的不是中文字符。该错误是由布局文件名引起的。您必须将布局文件名重命名为android studio的可接受格式。