I'm trying Vert.x in Kotlin. I have the following piece of code:
val deploymentOptions = DeploymentOptions()
deploymentOptions.setConfig(JsonObject().put("http.port", 8081))
Everything works fine. However, IntelliJ IDEA reports on the second line that I should use "Kotlin synthetic properties".
Any idea how to do that in this case. Also, I'm using Maven.
Solution:
deploymentOptions.config = JsonObject().put("http.port", 8081)
Thanks for the help :)
Synthetic properties to access views were created as a way to eliminate the common boilerplate of findViewById calls. These synthetics are provided by JetBrains in the Kotlin Android Extensions Gradle plugin (not to be confused with Android KTX).
Is findViewById deprecated? findViewById. Recently Android has announced that with Kotlin 1.4. 20, their Android Kotlin Extensions Gradle plugin will be deprecated and will no longer be shipped in the future Kotlin releases.
Kotlin Android Extensions is deprecated, which means that using Kotlin synthetics for view binding is no longer supported. If your app uses Kotlin synthetics for view binding, use this guide to migrate to Jetpack view binding.
The Kotlin Android Extensions is a compiler plugin that allows you to access views from your XML directly in activities, fragments and views using what they refer to as synthetic properties. To use it, ensure that the plugin is enabled in your module's build.gradle file: apply plugin: 'kotlin-android-extensions'
Hit alt+enter on that line. IDEA should suggest you a solution. Pick one.
Probably:
deploymentOptions.config = JsonObject().put("http.port", 8081)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With