【问题标题】:Execution failure in Android app for task ':app:dexDebug'任务':app:dexDebug'的Android应用程序执行失败
【发布时间】:2015-08-16 16:59:39
【问题描述】:

我是 android studio 的新手,正在制作一个简单的天气应用程序。我写了代码,但我仍然收到此错误:

任务 ':app:dexDebug' 执行失败。

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/lib/jvm/java-7-openjdk-amd64/bin/java'' 完成非零退出值 2

这是我的 build.gradle:

应用插件:'com.android.application'

android {
compileSdkVersion 22
buildToolsVersion "22.0.1"

defaultConfig {
    applicationId "com.example.aseem.sunshine.app"
    minSdkVersion 10
    targetSdkVersion 22
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'),   'proguard-rules.pro'
    }
}
  }

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile files('android-support-v7-appcompat.jar')
compile 'com.android.support:appcompat-v7:+'

}

谁能帮我解决这个错误并让程序运行?

【问题讨论】:

    标签: java android build


    【解决方案1】:

    com.android.support:appcompat-v7 库被包含在您的项目中两次。从您的build.gradle 中删除此行compile files('android-support-v7-appcompat.jar')。你也可以从你的项目中删除这个 .jar。

    【讨论】:

      猜你喜欢
      • 2015-07-16
      • 2023-03-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-12-13
      • 2015-05-16
      相关资源
      最近更新 更多