Ronald Balza
Ronald Balza

Reputation: 33

Kotlin (Android Studio) Unexpected tokens (use ';' to separate expressions on the same line)

could you kindly help me on this one please.

I just copied the code on the tutorial and yet there's an error showing on my screen :).

Log.d( tag: "MainActivity", textViewText) <-- here's the error and it says "Unexpected tokens (use ';' to separate expressions on the same line)"

Upvotes: 0

Views: 532

Answers (1)

Merthan Erdem
Merthan Erdem

Reputation: 6058

I assume you looked at a screen and didn't copy?

Android Studio sometimes shows the parameter name (that is present in the function declaration) with the parameter you specified.

Makes it easier to see what you are passing in most cases and when copying it automatically gets removed, but it's not really in the code so just seeing it and writing it the same way doesn't work

Upvotes: 1

Related Questions