Android gradle插件抱怨Uncaught翻译错误

我正在更新我的kotlin版本到1.0.0-beta-2423,我所做的就是更新相关依赖关系的版本号。 但是,当我运行assembleDebug任务,它抱怨这个错误。

:app:transformClassesWithDexForDebug Uncaught translation error: com.android.dx.cf.code.SimException: expected type java.lang.Object but found int Uncaught translation error: com.android.dx.cf.code.SimException: expected type java.lang.Object but found int 2 errors; aborting Error:Execution failed for task ':app:transformClassesWithDexForDebug'. > com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.7.0_75.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1 

我列出的所有依赖:

 apply plugin: 'com.android.application' apply plugin: 'kotlin-android' android { compileSdkVersion 23 buildToolsVersion "23.0.1" defaultConfig { applicationId "com.my.domain" minSdkVersion 18 targetSdkVersion 23 multiDexEnabled true versionCode 3 versionName "0.0.3" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } sourceSets { main.java.srcDirs += 'src/main/kotlin' } dexOptions { javaMaxHeapSize "4g" } packagingOptions { exclude 'META-INF/DEPENDENCIES' exclude 'META-INF/NOTICE' exclude 'META-INF/LICENSE' exclude 'META-INF/LICENSE.txt' exclude 'META-INF/NOTICE.txt' } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile project(':hermes') compile project(':widget') testCompile 'junit:junit:4.12' compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" compile "org.jetbrains.anko:anko-sdk23:$anko_version" compile "org.jetbrains.anko:anko-support-v4:$anko_version" apk "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" compile 'com.android.support:appcompat-v7:23.1.1' compile 'com.android.support:recyclerview-v7:23.1.1' compile 'com.android.support:design:23.1.1' compile 'com.android.support:support-annotations:23.1.1' compile 'com.android.support:percent:23.1.1' compile 'io.reactivex:rxkotlin:0.30.1' compile 'io.reactivex:rxandroid:1.0.1' compile 'io.reactivex:rxjava:1.0.14' compile 'io.reactivex:rxjava-math:1.0.0' compile 'com.fasterxml.jackson.module:jackson-module-kotlin:2.6.3-4' compile 'com.android.support:cardview-v7:23.1.1' compile 'com.google.android.gms:play-services-location:8.1.0' compile 'pl.charmas.android:android-reactive-location:0.8@aar' compile 'com.android.support:multidex:1.0.1' compile 'de.hdodenhof:circleimageview:1.3.0' } buildscript { ext.kotlin_version = '1.0.0-beta-2423' ext.anko_version = '0.7.3' repositories { mavenCentral() } dependencies { classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } repositories { mavenCentral() } 

这里怎么了?

更新:整个build.gradle是udpated

请尝试检查你正在使用的变量,他们可能在某个地方错了。

expected type java.lang.Object but found int ,是什么意思。

即使变量可以在Kotlin中推断出来,也有一些可能的情况,它不可能像你的情况那样。 只是IDE没有显示出来。

我创建了一个问题,请看它以获得更好的上下文。

科特林问题