No announcement yet.

Setting Up Kotlin With FTC

  • Filter
  • Time
  • Show
Clear All
new posts

  • Setting Up Kotlin With FTC

    • We use IntelliJ IDEA
    • We want to use Kotlin
    • We want to write using TDD
    Our team has been trying to set up Kotlin for programming in the FTC Skystone SDK. Because we do not fully understand Gradle-based programming, we have encountered several problems with setting it up. Additionally, we want to write code using TDD. In essence, we want to be able to run code on the desktop (in the command line) and write it in Kotlin. We have tried making a new Kotlin file and then just run the main method, which just prints "Kotlin Test", and then we got
    "Error: Could not find or load main class org.firstinspires....TestKt.
    Caused by java.lang.ClassNotFoundExcepion...
    We tried configuring Kotlin. First we tried simply switching the JDK from JDK 11 to Kotlin 1.3. The error we got said that "Unfourtunately, non-Gradle libraries cannot run in a gradle project." This meant we needed the Gradle-based Kotlin. We tried this too and changed the Gradle, but got a ton of errors. The FTC app could not locae the classes on the phone, syntax errors didn't load until runtime, etc. We simply can't figure out how to set this up. Getting code to run on the desktop with a main method was equally challenging. Changing the code wouldn't change the output when run until IntelliJ had restarted, syntax errors still didn't load until runtime, the project had to continually be rebuilt, and a ton of other errors we didn't even understand. We have tried this multiple times, at school, at home, on different computers and networks. We have tried changing the Gradle using IntelliJ's GUI and changing the files. We need help.
    Any assistance is appreciated.

  • #2
    Are you using github? do you have a repo I can look at? Or, would a generic skystone repo with kotlin and tests be all you need?