Reputation: 123
I found there is a ByteArray.toString(charset:Charset) function in Kotlin,when I use that function in android studio IDE,it gets a syntax error. But I have tried the same code in Kotlin org site, it works well. How can I convert a ByteArray to String in Kotlin?
Upvotes: 9
Views: 12356
Reputation: 201
It seems that you didn't configure your project for Kotlin (there is no kotlin-runtime.jar in your classpath). Try to select the line with the error, press Alt+Enter
and in context menu choose "Kotlin not configured" -> "Configure"
Or manually add kotlin-runtime.jar to your classpath
Upvotes: 4