Android Studio 2.3.1更新后,没有任何应用程序,甚至Hello World也无法运行。单击“运行”时会显示此错误。
Error:Error converting bytecode to dex: Cause: java.lang.RuntimeException: Exception parsing classes Error:Execution failed for task ':app:transformClassesWithDexForDebug'. com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: Unable to pre-dex 'C:\Android.android\build-cache\d6387c5ba7dcecea41b28c91351efa5624be8874\output\jars\classes.jar' to 'C:\Users\Deven\AndroidStudioProjects\ErrCheck\app\build\intermediates\transforms\dex\debug\folders\1000\10\classes_bff1bfdc5860437f946a228fbddc9242cb4ec753'
这只是一个 hello world 应用程序,没有任何编辑。
这是我的 build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
defaultConfig {
applicationId "com.example.android.errcheck"
minSdkVersion 23
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
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:multidex:1.0.1'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}
最佳答案
这是 Android Studio 本身的错误。我需要重新安装它,并且该错误已在后续版本中修复。
关于java - 无法在 Android Studio 2.3.1 中运行或模拟基本应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43290406/