Skip to content

Instantly share code, notes, and snippets.

@4sskick
Last active October 11, 2021 07:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 4sskick/c549873493e34f5b5cda18ed5e5c4ced to your computer and use it in GitHub Desktop.
Save 4sskick/c549873493e34f5b5cda18ed5e5c4ced to your computer and use it in GitHub Desktop.
trial error converting java to kotlin project pow-waiter
- first trial on converting into Kotlin (1.5.31) directly from Android Studio git error `Caused by: org.gradle.api.internal.plugins.PluginApplicationException: Failed to apply plugin [id 'kotlin-android'] and this `Caused by: org.gradle.api.GradleException: The current Gradle version 5.4.1 is not compatible with the Kotlin Gradle plugin. Please use Gradle 6.1.1 or newer, or the previous version of the Kotlin plugin.` ssems the point to solve
- it accessed via right click on package then choose convert to kotlin
- I change `distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip` on file `gradle-wrapper.properties` to recommendation version number
- with result, `Caused by: org.gradle.api.internal.plugins.PluginApplicationException: Failed to apply plugin [id 'realm-android']` and another `Caused by: org.gradle.api.artifacts.UnknownConfigurationException: Configuration with name 'kapt' not found.`
- I add these lines: `apply plugin: 'kotlin-android'` `apply plugin: 'kotlin-android-extensions'` `apply plugin: 'kotlin-kapt'`
- finished setup gradle & nothing happend, I checked file still not converted yet. I decide to re-run menu `convert java to kotlin` on IDE
- it takes some times . . . .
- waiting . . .
- and stuck on last phase (phase 7) *my case
- force close IDE & reopen, think about strategy to make converting process seamless
- finally I decide to convert it one by one per package & resolve it by accident
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment