Kotlin 1.0.4 EAP


#1

Kotlin 1.0.4 is almost around the corner, so the team is pleased to announce availability of the first 1.0.4 EAP build.

What’s new

  • Lots of bugs are fixed in the compiler and IDE.
  • A plenty of new intentions, inspections and quickfixes.
  • Gradle plugin is now compatible with Gradle 2.14.1 (previously a non-clean build could fail).

See the full changelog.

How to get EAP build

For Intellij IDEA

Configure Early Access Preview channel in Tools | Kotlin | Configure Kotlin Plugin Updates and press “Check for updates now”.

For Gradle or Maven

  1. Add https://dl.bintray.com/kotlin/kotlin-eap to your repositories.
  2. Change a version of Kotlin dependencies (a plugin and a stdlib) to 1.0.4-eap-62.

Please do provide feedback and report any issues to our issue tracker (please specify your plugin version and IDE version).


Using android data binding, now all types are unresolved reference
#2

This topic is now a banner. It will appear at the top of every page until it is dismissed by the user.


#3

The new EAP build 1.0.4-eap-100 is available.

What’s new:

  • The new kapt2 that implements JSR 269 for Kotlin (this should improve compatibility with existing annotation processors). This feature is considered experimental. To try it just add
apply plugin: 'kotlin-kapt'

to your gradle.build files and remove

kapt {
    generateStubs = true
}
  • Incremental compilation for Gradle now can track changes between the subprojects. This should improve build times (if IC is enabled) for multi-project builds.
  • It’s possible to evaluate Kotlin expressions when debugging Java files.
  • New bugfixes, intentions and quickfixes.

Full changelog (includes both EAPs changes).


#4

The new EAP build 1.0.4-eap-114 is available.

New since the last EAP:

  • Bugfixes for KAPT2 and “Convert lambda to reference” intention

#5

The new EAP build 1.0.4-eap-118 is available.
This build contains some bugfixes for KAPT2.


#7

I get error for kotlin-annotation-processing, after I have added the repo and changed the version variable. It is not searching the new repo, for this one?

Error:Could not find org.jetbrains.kotlin:kotlin-annotation-processing:1.0.4-eap-118.
Searched in the following locations:
https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-annotation-processing/1.0.4-eap-118/kotlin-annotation-processing-1.0.4-eap-118.pom
https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-annotation-processing/1.0.4-eap-118/kotlin-annotation-processing-1.0.4-eap-118.jar
https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-annotation-processing/1.0.4-eap-118/kotlin-annotation-processing-1.0.4-eap-118.pom
https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-annotation-processing/1.0.4-eap-118/kotlin-annotation-processing-1.0.4-eap-118.jar
file:/Volumes/Scintillate/Android/sdk/extras/android/m2repository/org/jetbrains/kotlin/kotlin-annotation-processing/1.0.4-eap-118/kotlin-annotation-processing-1.0.4-eap-118.pom
file:/Volumes/Scintillate/Android/sdk/extras/android/m2repository/org/jetbrains/kotlin/kotlin-annotation-processing/1.0.4-eap-118/kotlin-annotation-processing-1.0.4-eap-118.jar
file:/Volumes/Scintillate/Android/sdk/extras/google/m2repository/org/jetbrains/kotlin/kotlin-annotation-processing/1.0.4-eap-118/kotlin-annotation-processing-1.0.4-eap-118.pom
file:/Volumes/Scintillate/Android/sdk/extras/google/m2repository/org/jetbrains/kotlin/kotlin-annotation-processing/1.0.4-eap-118/kotlin-annotation-processing-1.0.4-eap-118.jar
Required by:
Twinkle:app:unspecified


#8

Make sure you have the repository:

maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }

added to both types of repository section:

  1. One is in the buildscript section (repositories for plugins).
  2. One is on the top-level of your build.gradle files that have any kotlin dependencies (or injected via allprojects/subprojects).

#9

:+1:


#10

Hi, I try using eap-118, but getting

  • What went wrong:
    A problem occurred evaluating project ‘:app’.

Could not find method kapt2() for arguments [com.google.dagger:dagger-compiler:2.6] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

Kotlin-kapt plugin is there. It’s android gradle ver 2.2. Thanks.

update Okay, I realized ‘kapt’ should be used instead of ‘kapt2’. No problem, works as expected!


#11

I have a code gen plugin that is throwing an error now. Is this class removed for some reason? (This plugin: https://github.com/nekocode/android-parcelable-intellij-plugin-kotlin)

java.lang.NoClassDefFoundError: org/jetbrains/kotlin/asJava/KtLightElement
at cn.nekocode.plugin.parcelablegenerator.utils.KtClassHelper.getKtClassForElement(KtClassHelper.java:62)
at cn.nekocode.plugin.parcelablegenerator.ParcelableAction.getPsiClassFromEvent(ParcelableAction.java:89)
at cn.nekocode.plugin.parcelablegenerator.ParcelableAction.update(ParcelableAction.java:69)
at com.intellij.openapi.actionSystem.AnAction.beforeActionPerformedUpdate(AnAction.java:246)
at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareUpdate(ActionUtil.java:117)
at com.intellij.ui.popup.PopupFactoryImpl$ActionStepBuilder.appendAction(PopupFactoryImpl.java:1045)
at com.intellij.ui.popup.PopupFactoryImpl$ActionStepBuilder.appendActionsFromGroup(PopupFactoryImpl.java:1035)
at com.intellij.ui.popup.PopupFactoryImpl$ActionStepBuilder.buildGroup(PopupFactoryImpl.java:971)
at com.intellij.ui.popup.PopupFactoryImpl$ActionGroupPopup.createStep(PopupFactoryImpl.java:280)
at com.intellij.ui.popup.PopupFactoryImpl$ActionGroupPopup.(PopupFactoryImpl.java:223)
at com.intellij.ui.popup.PopupFactoryImpl.createActionGroupPopup(PopupFactoryImpl.java:202)
at com.intellij.ui.popup.PopupFactoryImpl.createActionGroupPopup(PopupFactoryImpl.java:176)
at com.intellij.ui.popup.PopupFactoryImpl.createActionGroupPopup(PopupFactoryImpl.java:372)
at com.intellij.codeInsight.generation.actions.GenerateAction.actionPerformed(GenerateAction.java:38)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher$3.performAction(IdeKeyEventDispatcher.java:595)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction(IdeKeyEventDispatcher.java:646)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.inInitState(IdeKeyEventDispatcher.java:485)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.java:215)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:631)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:386)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)


#12

This class was moved to a different package.


#13

Is there is fix in 118 of https://youtrack.jetbrains.com/issue/KT-13371? I have got this error :disappointed_relieved:


#14

Yes. Please make sure that you’ve updated both the IDE plugin and the version of Kotlin in your build.gradle.


#15

Sure, I have checked, 1.0.4-eap-118 is the very first version that I have tried. May be this is another error.

What defined:
ext.kotlin_version = ‘1.0.4-eap-118’

Error trace:
e: java.lang.AssertionError: Rewrite at slice LEAKING_THIS key: REFERENCE_EXPRESSION old value: PropertyIsNull(property=private final val m: Matrix defined in ru.xxxx.xxx.fragments.analytics.SwitchAvatarButton[PropertyDescriptorImpl@195ae9ce], classOrObject=CLASS)@1425541271 new value: PropertyIsNull(property=private final val staticAvatarPosition: Point defined in ru.xxxx.xxx.fragments.analytics.SwitchAvatarButton[PropertyDescriptorImpl@77bea658], classOrObject=CLASS)@2130275126
File name: SwitchAvatarButton.kt Physical: true

java.lang.Throwable
at org.jetbrains.kotlin.com.intellij.openapi.diagnostic.Logger.error(Logger.java:127)
at org.jetbrains.kotlin.util.slicedMap.Slices$1.processRewrite(Slices.java:40)
at org.jetbrains.kotlin.util.slicedMap.SlicedMapImpl.put(SlicedMapImpl.java:60)


#16

Can you post a code fragment causing the issue?


#17

Only partially

So, generally it looks like
class SwitchAvatarButton : View {

private lateinit var movingAvatar: Bitmap

private lateinit var staticAvatar: Bitmap

private val staticAvatarPosition = Point()

private val movingAvatarPosition = Point()

private val srcRect = RectF()

private val dstRect = RectF()

private val m = Matrix()

private var positionAnimator: PositionAnimation? = null
...

}

If you need I will try to reproduce on example.


#18

So, generally it works where

Example class here:
ExampleButton.kt.zip (1.9 KB)


#19

Yes, thank you, problem is confirmed and will be fixed soon.


#20

1.0.4 is released!
See details: https://blog.jetbrains.com/kotlin/2016/09/kotlin-1-0-4-is-here/


#21

This topic is no longer a banner. It will no longer appear at the top of every page.