Hi all, check out pic...how can I run 'hello.kt'
# kotlin-native
f
Hi all, check out pic...how can I run 'hello.kt'
a
Hello! From the screenshot you posted below I see that you have Kotlin installed using
SDKMAN!
. This approach does not provide you with Kotlin/Native compiler, its support in SDKMAN were discussed some time ago and no decision was make there(https://youtrack.jetbrains.com/issue/KT-44288). To install Kotlin/Native compiler, please download it using GitHub Releases as described here, or let the Gradle do this by executing any kotlin-native task, e.g.
runDebugExecutableNative
in a project with kotlin-multiplatform plugin enabled and a native target defined. The Gradle would download the compiler into
~/.konan/kotlin-native-prebuilt-<os>-<arch>-<version>/bin/
.
f
I think I downed the source code v.1.5.10 from Github, not the compiler...
exception: org.jetbrains.kotlin.konan.MissingXcodeException: An error occurred during an xcrun execution. Make sure that Xcode and its command line tools are properly installed. My Os X version is El Capitan - too old to install XCode! Yes, I downed the correct compiler, and the code compiles -> konanc -o hello hello.kt; "Kotlin Apprentice" didn't say I need XCode!
a
@flygerian.eagle, I'm glad that you found the correct version of the compiler. Sorry for my recommendations being a little confusing here. About Xcode being required to run Kotlin/Native compiler on Mac machines. I knew about this requirement for a long time, but I was really upset to see that it does not seem to be present in the documentation. I will notify the documentation team about this situation ASAP. Without Xcode installed, Kotlin/Native will not be able to build for Mac and iOS targets, as their SDK are being distributed by Apple only inside Xcode Command Line Tools. However, I cannot do anything about "Kotlin Apprentice", as this book is published by third-party company. I see there is a discussion at https://forums.raywenderlich.com/t/chapter-25-kotlin-native/164816, I will subscribe for the details.