Brane
Brane

Reputation: 45

Kotlinx cannot resolve symbol "synthetic"

Trying Kotlin, Kotlin configured in project, kotlin-android-extensionsadded, dependency also added...

import kotlinx.android.**synthetic**.main.content_main.*

[]

Upvotes: 2

Views: 1630

Answers (2)

Ankit Kumar
Ankit Kumar

Reputation: 3721

class MainActivity : Activity() {}

Change your class from Java to Kotlin so that it can import kotlin packages

Upvotes: 1

Kingfisher Phuoc
Kingfisher Phuoc

Reputation: 8190

Yes, of course, you got the error. You must change your code to Kotlin not java. Something likes:

class YourActivity : AppCompatActivity(){
}

And remember that, it's should be import kotlinx.android.synthetic.main.activity_main.* not content_main

Upvotes: 4

Related Questions