未捕获的翻译错误:com.android.dx.cf.code.SimException:local 0007:invalid

问题描述 投票:2回答:1

我不使用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 gradle kotlin
1个回答
14
投票

类似的issue在谷歌问题跟踪器。

尝试在Android Studio中禁用“即时运行”

要禁用即时运行:

  1. 打开设置或首选项对话框。
  2. 导航到构建,执行,部署>即时运行。
  3. 取消选中启用即时运行旁边的复选框。
© www.soinside.com 2019 - 2024. All rights reserved.