El proyecto no se comstackrá con Kotlin 1.1.3

Tengo un proyecto de Android que he actualizado recientemente con 1.1.3, y cada vez que compilo recibo el siguiente error:

Error:Execution failed for task ':app:compileDebugJavaWithJavac'. > kotlin.jvm.internal.FunctionReference.<init>(ILjava/lang/Object;)V 

Otras preguntas típicamente dicen que significa que el stdlib no está incluido, pero definitivamente lo he agregado. 1.1.2-5 embargo, el uso de 1.1.2-5 funciona, y 1.1.3 ha funcionado para otros proyectos.

Solución

El problema estaba en mezclar el procesador de anotación con kapt. Para proyectos como DbFlow y Glide, la dependencia de AnnotationProcessor se puede usar directamente con kapt.

De vuelta a la pregunta original:

Aquí está mi logging de Travis y debajo están mis dependencies:

 dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) androidTestCompile('com.android.support.test.espresso:espresso-core:2.3-alpha', { exclude group: 'com.android.support', module: 'support-annotations' }) testCompile 'junit:junit:4.12' compile("ca.allanwang:kau:${KAU}") compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:${KOTLIN}" testCompile "org.jetbrains.kotlin:kotlin-test-junit:${KOTLIN}" debugCompile "com.squareup.leakcanary:leakcanary-android:${LEAK_CANARY}" releaseTestCompile "com.squareup.leakcanary:leakcanary-android-no-op:${LEAK_CANARY}" releaseCompile "com.squareup.leakcanary:leakcanary-android-no-op:${LEAK_CANARY}" testCompile "com.squareup.leakcanary:leakcanary-android-no-op:${LEAK_CANARY}" compile "com.github.Raizlabs.DBFlow:dbflow:${DBFLOW}" compile "com.github.Raizlabs.DBFlow:dbflow-core:${DBFLOW}" annotationProcessor "com.github.Raizlabs.DBFlow:dbflow-processor:${DBFLOW}" kapt "com.github.Raizlabs.DBFlow:dbflow-processor:${DBFLOW}" compile "com.github.Raizlabs.DBFlow:dbflow-kotlinextensions:${DBFLOW}" //Icons compile "com.mikepenz:material-design-iconic-typeface:${IICON_MATERIAL}@aar" compile "com.mikepenz:community-material-typeface:${IICON_COMMUNITY}@aar" compile "org.jsoup:jsoup:${JSOUP}" compile "com.github.bumptech.glide:glide:${GLIDE}" annotationProcessor "com.github.bumptech.glide:compiler:${GLIDE}" compile("com.mikepenz:materialdrawer:${MATERIAL_DRAWER}@aar") { transitive = true } compile "co.zsmb:materialdrawer-kt:${MATERIAL_DRAWER_KT}" compile "nz.bradcampbell:paperparcel:${PAPER_PARCEL}" compile "nz.bradcampbell:paperparcel-kotlin:${PAPER_PARCEL}" kapt "nz.bradcampbell:paperparcel-compiler:${PAPER_PARCEL}" compile "com.jude:swipebackhelper:${SWIPE_BACK}" compile("com.crashlytics.sdk.android:crashlytics:${CRASHLYTICS}@aar") { transitive = true; } } 

Aquí está el resultado del error cuando bash build con stacktrace completo: [Eliminado porque esta publicación fue demasiado larga] No estoy seguro de si ayuda, pero dbflow normalmente tiene la advertencia de cada compilation ya que no necesita generar las classs cada hora. He enviado una pregunta a su repository, pero no creo que ese sea el problema, ya que funciona bien con 1.1.2-5

Editar 2: ./gradlew dependencies un vistazo a ./gradlew dependencies y todas mostraron kotlin 1.1.3 (demasiado time para publicar aquí). Hubo algunos que dependían de 1.1.0 de sus fonts github, pero eso no debería verse afectado y excluir esos std-libs no resolvió el error.

Edición 3: Al intentar la .gradlew app:dependencies | grep org.jetbrains.kotlin .gradlew app:dependencies | grep org.jetbrains.kotlin Obtengo lo siguiente:

 $ ./gradlew app:dependencies | grep org.jetbrains.kotlin | | +--- org.jetbrains.kotlin:kotlin-stdlib-jre8:1.1.1 -> 1.1.2-3 | | | \--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.2-3 -> 1.1.3 | | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.1.3 | \--- org.jetbrains.kotlin:kotlin-stdlib-jre8:1.1.2-3 (*) | +--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.3 (*) | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.1.3 (*) | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.0.4 -> 1.1.3 (*) | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.0.4 -> 1.1.3 (*) +--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.3 (*) | +--- org.jetbrains.kotlin:kotlin-stdlib:1.1.2-3 -> 1.1.3 (*) | +--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.2-3 -> 1.1.3 (*) | +--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.3 | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.1.3 | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.1.3 (*) | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.0.4 -> 1.1.3 (*) | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.0.4 -> 1.1.3 (*) +--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.3 (*) | +--- org.jetbrains.kotlin:kotlin-stdlib:1.1.2-3 -> 1.1.3 (*) | +--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.2-3 -> 1.1.3 (*) | +--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.3 | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.1.3 | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.1.3 (*) | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.0.4 -> 1.1.3 (*) | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.0.4 -> 1.1.3 (*) +--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.3 (*) | +--- org.jetbrains.kotlin:kotlin-stdlib:1.1.2-3 -> 1.1.3 (*) | +--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.2-3 -> 1.1.3 (*) | | +--- org.jetbrains.kotlin:kotlin-stdlib-jre8:1.1.1 -> 1.1.2-3 | | | \--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.2-3 -> 1.1.3 | | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.1.3 | \--- org.jetbrains.kotlin:kotlin-stdlib-jre8:1.1.2-3 (*) | +--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.3 (*) | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.1.3 (*) | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.0.4 -> 1.1.3 (*) | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.0.4 -> 1.1.3 (*) +--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.3 (*) | +--- org.jetbrains.kotlin:kotlin-stdlib:1.1.2-3 -> 1.1.3 (*) | +--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.2-3 -> 1.1.3 (*) | +--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.3 | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.1.3 | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.1.3 (*) | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.0.4 -> 1.1.3 (*) | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.0.4 -> 1.1.3 (*) +--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.3 (*) | +--- org.jetbrains.kotlin:kotlin-stdlib:1.1.2-3 -> 1.1.3 (*) | +--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.2-3 -> 1.1.3 (*) | +--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.3 | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.1.3 | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.1.3 (*) | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.0.4 -> 1.1.3 (*) | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.0.4 -> 1.1.3 (*) +--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.3 (*) | +--- org.jetbrains.kotlin:kotlin-stdlib:1.1.2-3 -> 1.1.3 (*) | +--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.2-3 -> 1.1.3 (*) | | +--- org.jetbrains.kotlin:kotlin-stdlib-jre8:1.1.1 -> 1.1.2-3 | | | \--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.2-3 -> 1.1.3 | | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.1.3 | \--- org.jetbrains.kotlin:kotlin-stdlib-jre8:1.1.2-3 (*) | +--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.3 (*) | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.1.3 (*) | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.0.4 -> 1.1.3 (*) | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.0.4 -> 1.1.3 (*) +--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.3 (*) | +--- org.jetbrains.kotlin:kotlin-stdlib:1.1.2-3 -> 1.1.3 (*) | +--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.2-3 -> 1.1.3 (*) | +--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.3 | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.1.3 | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.1.3 (*) | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.0.4 -> 1.1.3 (*) | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.0.4 -> 1.1.3 (*) +--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.3 (*) | +--- org.jetbrains.kotlin:kotlin-stdlib:1.1.2-3 -> 1.1.3 (*) | +--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.2-3 -> 1.1.3 (*) | +--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.3 | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.1.3 | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.1.3 (*) | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.0.4 -> 1.1.3 (*) | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.0.4 -> 1.1.3 (*) +--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.3 (*) | +--- org.jetbrains.kotlin:kotlin-stdlib:1.1.2-3 -> 1.1.3 (*) | +--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.2-3 -> 1.1.3 (*) | | +--- org.jetbrains.kotlin:kotlin-stdlib-jre8:1.1.1 -> 1.1.2-3 | | | \--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.2-3 | | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.1.2-3 | \--- org.jetbrains.kotlin:kotlin-stdlib-jre8:1.1.2-3 (*) | +--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.3 | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.1.3 | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.1.3 (*) | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.0.4 -> 1.1.3 (*) | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.0.4 -> 1.1.3 (*) +--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.3 (*) | +--- org.jetbrains.kotlin:kotlin-stdlib:1.1.2-3 -> 1.1.3 (*) | +--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.2-3 -> 1.1.3 (*) +--- org.jetbrains.kotlin:kotlin-annotation-processing:1.1.3 | \--- org.jetbrains.kotlin:kotlin-stdlib:1.1.3 | | +--- org.jetbrains.kotlin:kotlin-stdlib-jre8:1.1.1 -> 1.1.2-3 | | | \--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.2-3 | | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.1.2-3 -> 1.1.3 (*) | \--- org.jetbrains.kotlin:kotlin-stdlib-jre8:1.1.2-3 (*) +--- org.jetbrains.kotlin:kotlin-annotation-processing:1.1.3 | \--- org.jetbrains.kotlin:kotlin-stdlib:1.1.3 | | +--- org.jetbrains.kotlin:kotlin-stdlib-jre8:1.1.1 -> 1.1.2-3 | | | \--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.2-3 | | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.1.2-3 -> 1.1.3 (*) | \--- org.jetbrains.kotlin:kotlin-stdlib-jre8:1.1.2-3 (*) +--- org.jetbrains.kotlin:kotlin-annotation-processing:1.1.3 | \--- org.jetbrains.kotlin:kotlin-stdlib:1.1.3 | | +--- org.jetbrains.kotlin:kotlin-stdlib-jre8:1.1.1 -> 1.1.2-3 | | | \--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.2-3 | | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.1.2-3 -> 1.1.3 (*) | \--- org.jetbrains.kotlin:kotlin-stdlib-jre8:1.1.2-3 (*) +--- org.jetbrains.kotlin:kotlin-annotation-processing:1.1.3 | \--- org.jetbrains.kotlin:kotlin-stdlib:1.1.3 | | +--- org.jetbrains.kotlin:kotlin-stdlib-jre8:1.1.1 -> 1.1.2-3 | | | \--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.2-3 | | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.1.2-3 -> 1.1.3 (*) | \--- org.jetbrains.kotlin:kotlin-stdlib-jre8:1.1.2-3 (*) +--- org.jetbrains.kotlin:kotlin-annotation-processing:1.1.3 | \--- org.jetbrains.kotlin:kotlin-stdlib:1.1.3 | | +--- org.jetbrains.kotlin:kotlin-stdlib-jre8:1.1.1 -> 1.1.2-3 | | | \--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.2-3 | | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.1.2-3 -> 1.1.3 (*) | \--- org.jetbrains.kotlin:kotlin-stdlib-jre8:1.1.2-3 (*) +--- org.jetbrains.kotlin:kotlin-annotation-processing:1.1.3 | \--- org.jetbrains.kotlin:kotlin-stdlib:1.1.3 | | +--- org.jetbrains.kotlin:kotlin-stdlib-jre8:1.1.1 -> 1.1.2-3 | | | \--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.2-3 | | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.1.2-3 -> 1.1.3 (*) | \--- org.jetbrains.kotlin:kotlin-stdlib-jre8:1.1.2-3 (*) +--- org.jetbrains.kotlin:kotlin-annotation-processing:1.1.3 | \--- org.jetbrains.kotlin:kotlin-stdlib:1.1.3 | | +--- org.jetbrains.kotlin:kotlin-stdlib-jre8:1.1.1 -> 1.1.2-3 | | | \--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.2-3 | | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.1.2-3 -> 1.1.3 (*) | \--- org.jetbrains.kotlin:kotlin-stdlib-jre8:1.1.2-3 (*) +--- org.jetbrains.kotlin:kotlin-annotation-processing:1.1.3 | \--- org.jetbrains.kotlin:kotlin-stdlib:1.1.3 | | +--- org.jetbrains.kotlin:kotlin-stdlib-jre8:1.1.1 -> 1.1.2-3 | | | \--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.2-3 | | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.1.2-3 -> 1.1.3 (*) | \--- org.jetbrains.kotlin:kotlin-stdlib-jre8:1.1.2-3 (*) +--- org.jetbrains.kotlin:kotlin-annotation-processing:1.1.3 | \--- org.jetbrains.kotlin:kotlin-stdlib:1.1.3 | | +--- org.jetbrains.kotlin:kotlin-stdlib-jre8:1.1.1 -> 1.1.2-3 | | | \--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.2-3 | | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.1.2-3 -> 1.1.3 (*) | \--- org.jetbrains.kotlin:kotlin-stdlib-jre8:1.1.2-3 (*) 

En mi experiencia, tú:

  1. No debería mezclar kapt y annotationProcessor
  2. Use kapt3 , mediante el uso del apply plugin: 'kotlin-kapt'
  3. No use kapt { generateStubs true } } (no está permitido con kapt3 )

También verifique si su plugin de Kotlin y su plugin de Gradle están actualizados.
Además, generalmente no uso la versión jre7 de la lib estándar, pero dudo que este sea el problema aquí.

Aquí hay una list más exhaustiva de "algo con Kotlin no funciona": https://gist.github.com/lmller/3c43eff454f7508474210fb2491b488a

el post de error informado como:

java.lang.NoSuchMethodError:

kotlin.jvm.internal.FunctionReference. <init> ( ILjava / lang / Object; ) V es constructor (Int, Object)

el constructor se presenta en kotlin 1.1 como a continuación:

 @SinceKotlin(version = "1.1") public FunctionReference(int arity, Object receiver) { super(receiver); this.arity = arity; } 

puede ejecutar ./gradlew dependencies y search qué dependencia usa la kotlin-stdlib < 1.1 . y lo excluye de su proyecto. algo como esto a continuación:

 dependencies{ compile('which dependency use stdlib < 1.1'){ exclude group:'org.jetbrains.kotlin', module:'kotlin-stdlib' } } 

añadir:

aplicar el complemento: 'kotlin-kapt'

enter image description here

  • Kotlin null de Java
  • ¿Cómo negar una expresión booleana cuando se usa el operador elvis en kotlin?
  • Cómo componer nulables en Kotlin
  • El tipo Out-Projected 'ArrayList <*>' prohíbe el uso de 'public fun fun add (índice: Int, elemento: E): Unidad definida en java.util.ArrayList'
  • La compilation de Gradle no puede encontrar tornadofx en Linux
  • Deserializar classs con properties perezosas usando Gson y Kotlin 1.0 beta 4
  • Las dependencies de Bintray no se downloadán en InteliJ
  • ¿Cómo hacer que los constructores seguros de Kotlin trabajen en Scala?
  • ¿Cómo usar Kotlin en una aplicación de Android existente?
  • Agregar idioma al keyboard sin abrir la configuration
  • Kotlin - Extensión para la class final