java - Gradle 构建失败 : Error:Execution failed for task ':app:processDebugResources' . > java.nio.charset.MalformedInputException:输入长度 = 1

标签 java android android-studio

在 Android Studio(2.3 版)中,当我尝试构建(或清理)任何项目时,我收到此错误。

Error:Execution failed for task ':app:processDebugResources'.
> java.nio.charset.MalformedInputException: Input length = 1

Error Image

如何解决这个问题呢?我进行了很多搜索,但找不到任何解决方案。请帮忙。

更新:

应用程序:gradle 代码:
apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.0"
    defaultConfig {
        applicationId "net.net23.fahimabrar.teacherassistant"
        minSdkVersion 15
        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'
        }
    }
}

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 'com.android.support:appcompat-v7:25.0.1'
    compile 'com.android.support:design:25.0.1'
    compile 'com.android.support:support-v4:25.0.1'
    compile 'com.android.support:gridlayout-v7:25.0.1'
    compile 'com.facebook.stetho:stetho:1.4.2'
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:recyclerview-v7:25.0.1'
    compile 'com.android.support:cardview-v7:25.0.1'
}

最佳答案

文件 -> 项目结构 -> 选择“项目”选项卡,确保项目中每个模块的“构建工具版本”彼此相同。(我的版本是 25.0.0)

关于java - Gradle 构建失败 : Error:Execution failed for task ':app:processDebugResources' . > java.nio.charset.MalformedInputException:输入长度 = 1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43049053/

相关文章:

来自套接字的 Java 堆内存错误

java - 返回按钮 -> 模拟主页按钮

android - NFC-V 写入标签 + onClickListener

java - Android Realm 大文件大小

安卓工作室 : Generated Release APK not working

Java:为什么我不能插入参数而不是 %s?

java - JSF中获取组件的高度

Android OpenGL ES 通过 NDK : placement of jpg decompression and binding to texture

android - Intellij IDEA CE 12 Android XML 代码完成不工作

macos - Android Studio 在 macbook 上滞后