We’re happy to announce the release of Kotlin 1.2.70, a new bugfix and tooling update for Kotlin 1.2. This release:
- Significantly improves incremental compilation for Kotlin/JS
- Marks a number of
kotlin-stdlib-commonannotations with@OptionalExpectation - Contains native binaries built with Excelsior JET for the standalone Kotlin compiler
- Adds new refactorings, inspections, and intentions to the IntelliJ IDEA plugin
- Fixes a lot of known issues in the compiler and the IDE plugin and provides performance improvements
The update is compatible with all versions of IntelliJ IDEA from 2017.3 to 2018.3, as well as with Android Studio 3.1, 3.2 RC, and 3.3 Canary.
We’d like to thank our external contributors whose pull requests were included in this release: Toshiaki Kameyama, Lucas Smaira, Raluca Sauciuc, Denis Vnukov, Jonathan Lermitage, Jake Wharton, gen, Takasy, Bloder, Artem Zinnatullin, Kenji Tomita, Nico Mandery and Juan Chen
The complete list of changes in this release can be found in the changelog. Read on for the highlights.
Incremental compilation improvements for Kotlin/JS
Incremental compilation has been greatly improved for Kotlin/JS. Depending on the project structure, this can speed up development builds up to 7 times and even more. Also, Kotlin/JS Gradle builds now support cross-module incremental compilation.
Note that it is still experimental and disabled by default. To try it, you need to enable it explicitly:
- In a Gradle project, add
kotlin.incremental.js=trueintogradle.propertiesorlocal.properties - In a project built with IntelliJ IDEA, go to Settings | Build, Execution, Deployment | Compiler | Kotlin Compiler | Kotlin to JavaScript and check Enable incremental compilation (experimental).
Your feedback is welcome, and if you face any issues with Kotlin/JS incremental compilation, please tell us.
Multiplatform projects update
A number of platform-specific annotations were introduced in kotlin-stdlib-common. They are marked with the @OptionalExpectation annotation introduced in 1.2.60. The compiler will ignore these annotations on common declarations during compilation of platform modules that have no corresponding actual annotation class.
For example, this allows you to use some JVM-specific annotations such as @JvmName in the common code of a multiplatform project and compile it to JavaScript without any problems.
Those annotations are @JsName, @JvmOverloads, @JvmStatic, @JvmName, @JvmMultifileClass, @JvmField, @JvmSuppressWildcards, @JvmWildcard, @Volatile, @Transient, @Strictfp, and @Synchronized
IntelliJ IDEA support improvements
Quick Fix to convert chains of collection functions into sequences
There’s a new inspection with a quick fix for converting a non-lazy collection transformations chain into a sequence equivalent. Using sequences helps avoid unnecessary temporary allocations overhead and, may significantly improve performance of complex processing pipelines:

Other improvements in the IntelliJ IDEA plugin
- Intentions to replace an
ifnull-check with?.letand the other way around - Inspection to detect unnecessary
withcalls - Intention to convert a property getter to initializer
- Inspection and quickfix to replace
assertTrue(a == b)withassertEquals(a, b) - “Redundant return label” inspection
- Quick-fix for default parameter value removal
- “
forEachparameter unused” inspection - Lots of bug fixes and performance improvements
Standalone Kotlin compiler native binaries
In addition to the JVM version of the standalone Kotlin compiler, the Github releases now contain a native, system-dependent version for every major platform (Linux, macOS, and Windows). Those binaries are built with the Excelsior JET AOT compiler and have faster startup times, which is suitable for building small files or scripts.
The Excelsior JET runtime supports some JVM and specific options that you may pass with -J using the kotlinc wrapper script. All recognized options may be found in the Excelsior JET documentation.
How to update
To update your IntelliJ IDEA or Android Studio plugin, use Tools | Kotlin | Configure Kotlin Plugin Updates and click the “Check for updates now” button. The Eclipse IDE plugin can be installed or updated via the Eclipse Marketplace (Help | Eclipse Marketplace and search for the Kotlin plugin).
Also, don’t forget to update the compiler and standard library version in your Maven and Gradle build scripts.
As usual, if you run into any problems with the new release, you’re welcome to ask for help on the forums, on Slack (get an invite here), or to report issues in the issue tracker.
Let’s Kotlin!
Pingback: Kotlin 1.2.70 发布,增量编译速度提高 7 倍-八九社区
I think Slack Invite don’t working: http://slack.kotlinlang.org/
All invites are processed manually, so please be patient
Too Many thanks For Kotlin 1.2.7
here some kotlin . which is original ?
https://android-apk.org/search.php?q=Kotlin
You can get the standalone compiler here: https://github.com/JetBrains/kotlin/releases/tag/v1.2.70
Awesome!
I’m curious as to why Excelsior JET was used to build the native binaries and not java AOT or GraalVM.
I just tried AOT compiling it with jaotc from Java 10, but that just made it slower. Normally, on my very old machine, kotlinc compiles “hello world” in 7.5 seconds. With an AOT-compiled compiler it takes 9.5 seconds.
Perhaps I did something wrong. I’d be very happy if it could be made faster.
Pingback: This week #4 – 9월 3주차 | Lawrence's Blog
What is the Kotlin compiler settings? The update is asking me to either migrate or cancel. I clicked migrate and now I am wondering it is going to break my build.
https://imgur.com/a/wt5hPfm
You can see all migrations that are potentially applied in “Preferences | Editor | Inspections | Kotlin | Migration”. It shouldn’t break your build, however if you encounter any problems with this feature, please file an issue here: http://kotl.in/issue
Thanks!
Pingback: Kotlin: Neues Update bringt blitzschnellen Javascript-Compiler
Pingback: Kotlin: Neues Update bringt einen blitzschnellen Javascript-Compiler
Pingback: Kotlin: Das neue Update bringt einen blitzschnellen Javascript-Compiler
Pingback: Kotlin: Das neue Update bringt blitzschnellen Javascript-Compiler
Yes Freddy!
Why we need to use kotlin for app development
https://xtreemsolution.com/blog/reasons-to-use-kotlin-to-develop-android-apps
Pingback: Kotlin 1.2.70 ist erschienen und verbessert die inkrementelle Kompilierung für Kotlin/JS - JAXenter
Good! Incremental JS compilation works really fast! But it seems that it has some issues with Hot Module Replace (HMR). After applying any change the state is not preserved and console.log shows these errors:
VM2332 client:156 [WDS] Errors while compiling. Reload prevented.
errors @ VM2332 client:156
onmessage @ VM2344 socket.js:41
EventTarget.dispatchEvent @ VM2345 sockjs.js:170
(anonymous) @ VM2345 sockjs.js:887
SockJS._transportMessage @ VM2345 sockjs.js:885
EventEmitter.emit @ VM2345 sockjs.js:86
WebSocketTransport.ws.onmessage @ VM2345 sockjs.js:2961
VM2332 client:162 ./frontend-only.js
Module build failed: Error: ENOENT: no such file or directory, open ‘/home/anton/projects/other/todo-kotlin-react-example/build/js/frontend-only.js’
errors @ VM2332 client:162
onmessage @ VM2344 socket.js:41
EventTarget.dispatchEvent @ VM2345 sockjs.js:170
(anonymous) @ VM2345 sockjs.js:887
SockJS._transportMessage @ VM2345 sockjs.js:885
EventEmitter.emit @ VM2345 sockjs.js:86
WebSocketTransport.ws.onmessage @ VM2345 sockjs.js:2961
2VM2332 client:74 [WDS] App updated. Recompiling…
VM2332 client:218 [WDS] App hot update…
VM2357 log.js:24 [HMR] Checking for updates on the server…
VM2357 log.js:26 [HMR] Cannot apply update. Need to do a full reload!
module.exports @ VM2357 log.js:26
(anonymous) @ VM2356 dev-server.js:39
Promise.catch (async)
check @ VM2356 dev-server.js:36
(anonymous) @ VM2356 dev-server.js:55
EventEmitter.emit @ VM2359 events.js:81
reloadApp @ VM2332 client:221
ok @ VM2332 client:134
onmessage @ VM2344 socket.js:41
EventTarget.dispatchEvent @ VM2345 sockjs.js:170
(anonymous) @ VM2345 sockjs.js:887
SockJS._transportMessage @ VM2345 sockjs.js:885
EventEmitter.emit @ VM2345 sockjs.js:86
WebSocketTransport.ws.onmessage @ VM2345 sockjs.js:2961
VM2357 log.js:26 [HMR] Error: Module build failed: Error: ENOENT: no such file or directory, open ‘/home/anton/projects/other/todo-kotlin-react-example/build/js/frontend-only.js’
at eval (webpack:///./frontend-only.js?:1:7)
at Object../frontend-only.js (http://localhost:8088/main.357fbc9e426459751786.hot-update.js:172:1)
at webpack_require (http://localhost:8088/main.bundle.js:725:30)
at hotApply (http://localhost:8088/main.bundle.js:658:14)
at http://localhost:8088/main.bundle.js:315:22
module.exports @ VM2357 log.js:26
(anonymous) @ VM2356 dev-server.js:43
Promise.catch (async)
check @ VM2356 dev-server.js:36
(anonymous) @ VM2356 dev-server.js:55
EventEmitter.emit @ VM2359 events.js:81
reloadApp @ VM2332 client:221
ok @ VM2332 client:134
onmessage @ VM2344 socket.js:41
EventTarget.dispatchEvent @ VM2345 sockjs.js:170
(anonymous) @ VM2345 sockjs.js:887
SockJS._transportMessage @ VM2345 sockjs.js:885
EventEmitter.emit @ VM2345 sockjs.js:86
WebSocketTransport.ws.onmessage @ VM2345 sockjs.js:2961
Please report this issue in the bug tracker http://kotl.in/issue and include steps to reproduce and a sample project if possible. Thank you!
Pingback: Kotlin 1.2.70 发布 - kotlin Blog
Pingback: Android: инструменты программиста и новые возможности Kotlin | Coin-Insider.ru
Pingback: Android: инструменты программиста и новые возможности Kotlin | UA PROTECTION