Reputation: 45
Trying Kotlin, Kotlin configured in project, kotlin-android-extensions
added, dependency also added...
import kotlinx.android.**synthetic**.main.content_main.*
[
Upvotes: 2
Views: 1630
Reputation: 3721
class MainActivity : Activity() {}
Change your class from Java to Kotlin so that it can import kotlin packages
Upvotes: 1
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