【发布时间】:2016-03-31 16:03:32
【问题描述】:
我无法运行我的应用程序。每次我尝试在模拟器 Android Studio 中运行我的应用时,都会显示以下错误。
错误:任务 ':app:transformClassesWithDexForDebug' 执行失败。> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException : Process 'command 'C:\Program Files (x86)\Java\jdk1.8.0_66\bin\java.exe'' 以非零退出值 2 结束
这是我的 build.gradle 文件。build.gradle(app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.gripxtech.kasim.unipayretailer"
minSdkVersion 10
targetSdkVersion 23
versionCode 1
versionName '1.0'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
productFlavors {
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:cardview-v7:23.1.1'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.malinskiy:superrecyclerview:1.1.1'
compile 'org.apache.commons:commons-lang3:3.4'
compile 'com.codinguser.android:contactpicker:3.0.0@aar'
compile 'com.squareup.okhttp:okhttp:2.7.0'
compile project(':materialdatetimepick')
}
build.gradle(Project)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
}
}
allprojects {
repositories {
jcenter()
}
}
我已经尝试从许多与我类似的问题中应用解决方案,但是我仍然无法解决我的问题。提前致谢。
【问题讨论】:
-
你尝试清理项目了吗?
-
是的,我试过清理而不是重建项目。但是,这对我不起作用。目前我正在尝试创建新项目,而不是在新创建的项目中复制我的所有文件。希望这对我有用。
标签: java android android-studio android-gradle-plugin