【问题标题】:Android Studio / Gradle errorsAndroid Studio / Gradle 错误
【发布时间】:2016-12-13 10:47:37
【问题描述】:

我的项目运行良好,但当我尝试重建它时突然出现以下错误:

信息:Gradle 任务 [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :buttonstyle:generateDebugSources, :buttonstyle:mockableAndroidJar, :buttonstyle:prepareDebugUnitTestDependencies, :buttonstyle:generateDebugAndroidTestSources]

错误:java.util.concurrent.ExecutionException:com.android.ide.common.process.ProcessException: 错误:任务 ':app:mergeDebugResources' 执行失败。

错误:java.util.concurrent.ExecutionException:com.android.ide.common.process.ProcessException:

这是我的构建 gradle 文件:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.1"
    defaultConfig {
        applicationId "ba.application.travel"
        minSdkVersion 19
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        externalNativeBuild {
            cmake {
                cppFlags "-std=c++11"
            }
        }
        dexOptions {
            javaMaxHeapSize "4g"
        }
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    externalNativeBuild {
        cmake {
            path "CMakeLists.txt"
        }
    }
    sourceSets { main { assets.srcDirs = ['src/main/assets'] } }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.0.1'
    compile project(':buttonstyle')

    compile 'com.android.support:design:25.0.1'
    compile 'com.android.support:appcompat-v7:25.0.1'
    compile 'com.android.support:percent:25.0.1'
    compile 'com.ashokvarma.android:bottom-navigation-bar:1.3.0'
    compile 'com.android.support:support-v4:25.0.1'
    compile 'com.android.support:gridlayout-v7:25.0.1'
    compile 'com.android.support:cardview-v7:25.0.1'
    compile 'com.android.support:recyclerview-v7:25.0.1'
    compile 'com.akexorcist:RoundCornerProgressBar:2.0.3'
    compile 'com.github.aakira:expandable-layout:1.4.2@aar'
    compile 'com.github.grennis:ExpandableRecyclerView:0.9.3'
    compile 'com.github.markushi:circlebutton:1.1'
    testCompile 'junit:junit:4.12'
}

【问题讨论】:

  • defaultConfig { // 启用多索引支持。 multiDexEnabled true }
  • 使用它并重建代码

标签: java android gradle


【解决方案1】:

尝试启用多索引支持。请参阅以下链接,了解在您的项目中启用 multidex 支持的步骤。
Enabling multidex support

【讨论】:

  • 我启用了multidex支持,但没有效果。我仍然遇到同样的错误。
【解决方案2】:

我通过将图像格式从 .jpg 更改为 .png 解决了这个问题

【讨论】:

    猜你喜欢
    • 2017-11-23
    • 1970-01-01
    • 1970-01-01
    • 2017-07-23
    • 2018-06-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多