Issue
I'm using Android Studio 3.2 and trying to run a scratch file, but can't find where println is output.
Contents of my scratch file:
fun main(args: Array<String>) {
println("Hello, world!")
}
But the output window is missing "Hello, world!"
Am I looking in the wrong place?
Solution
A .kts
file doesn't require a main
function. You can add the print statement at the top level.
This would explain the warning about args
being unused, since main
is never invoked.
A script is a Kotlin source file (.kts) with top level executable code.
Using the command line to run scripts
Answered By - Salem
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.