未捕获的翻译错误:com.android.dx.cf.code.SimException:本地0007:无效

我不使用Proguard 。 项目正在建设成功,但是当我尝试在设备上运行时,它显示此错误。 我在Android Studio 3.0中用Kotlin项目工作真的很糟糕的经验,我决定切换回2.3 AS,但问题仍然是一样的,日志较小,但异常文本是相同的。

apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-android-extensions' tasks.withType(JavaCompile) { options.fork = true options.incremental = true } android { def rootProject = rootProject.ext compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion defaultConfig { minSdkVersion rootProject.minSdkVersion targetSdkVersion rootProject.targetSdkVersion versionCode rootProject.versionCode versionName rootProject.versionName testInstrumentationRunner rootProject.testInstrumentationRunner vectorDrawables.useSupportLibrary = true // multiDexEnabled true } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } debug { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } productFlavors { //flavorDimensions "content" production { // dimension "content" } staging { //dimension "content" } } // Remove productionDebug and stagingRelease as it's not needed. android.variantFilter { variant -> if (variant.buildType.name == 'release' && variant.getFlavors().get(0).name == 'staging') { variant.setIgnore(true) } else if (variant.buildType.name == 'debug' && variant.getFlavors().get(0).name == 'production') { variant.setIgnore(true) } } packagingOptions { exclude 'META-INF/LICENSE.txt' exclude 'META-INF/NOTICE.txt' } } // Required for annotation processing plugins like Dagger kapt { generateStubs = true } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" compile 'com.android.support:appcompat-v7:26.0.0-beta2' compile 'com.android.support:design:26.0.0-beta2' compile 'com.android.support.constraint:constraint-layout:1.0.2' //firebase compile "com.google.firebase:firebase-auth:$firebaseVersion" compile "com.google.firebase:firebase-database:$firebaseVersion" compile "com.google.firebase:firebase-core:$firebaseVersion" compile "com.google.firebase:firebase-storage:$firebaseVersion" //rx compile "io.reactivex.rxjava2:rxjava:$rxVersion" compile "io.reactivex.rxjava2:rxandroid:$rxAndroidVersion" //mvp compile "com.hannesdorfmann.mosby3:mvp:$mosbyVersion" compile 'com.hannesdorfmann.mosby3:mvp-conductor:3.0.0' //dagger compile "com.google.dagger:dagger:$daggerVersion" kapt "com.google.dagger:dagger-compiler:$daggerVersion" //image loader compile 'com.github.bumptech.glide:glide:4.0.0-RC1' kapt 'com.github.bumptech.glide:compiler:4.0.0-RC1' //to work with dates compile 'net.danlew:android.joda:2.9.9' //bottom-bar compile 'com.aurelhubert:ahbottomnavigation:2.0.6' compile 'com.bluelinelabs:conductor:2.1.4' //leak canary debugCompile "com.squareup.leakcanary:leakcanary-android:$leakcanaryVersion" releaseCompile "com.squareup.leakcanary:leakcanary-android-no-op:$leakcanaryVersion" // testcompile "com.squareup.leakcanary:leakcanary-android-no-op:$leakcanaryVersion" } apply plugin: 'com.google.gms.google-services' 

谷歌问题跟踪器中的类似问题 。

尝试在Android Studio中停用即时运行

要禁用即时运行:

  1. 打开设置或首选项对话框。

  2. 导航到生成,执行,部署>即时运行。

  3. 取消选中“启用即时运行”旁边的复选框。