After Convert Java File to Kotlin File, gives me two errors in same line: In code below show variables and function with error
lateinit var ncArr: Array<ImageButton>
lateinit var xBitmap: Bitmap
lateinit var oBitmap: Bitmap
lateinit var intArr: IntArray
lateinit var btnStartGame: Button
lateinit var btnMenu: Button
var stop: Boolean = false
var gameMode: Int = 0
var umove: Int = 0
override fun onCreate(savedInstanceState: Bundle?) {
super.onStart()
setContentView(R.layout.activity_game)
ncArr = arrayOfNulls(9)
ncArr[0] = findViewById(R.id.nc0) as ImageButton
ncArr[1] = findViewById(R.id.nc1) as ImageButton
ncArr[2] = findViewById(R.id.nc2) as ImageButton
ncArr[3] = findViewById(R.id.nc3) as ImageButton
ncArr[4] = findViewById(R.id.nc4) as ImageButton
ncArr[5] = findViewById(R.id.nc5) as ImageButton
ncArr[6] = findViewById(R.id.nc6) as ImageButton
ncArr[7] = findViewById(R.id.nc7) as ImageButton
ncArr[8] = findViewById(R.id.nc8) as ImageButton
ncArr[0].setOnClickListener(this)
ncArr[1].setOnClickListener(this)
ncArr[2].setOnClickListener(this)
ncArr[3].setOnClickListener(this)
ncArr[4].setOnClickListener(this)
ncArr[5].setOnClickListener(this)
ncArr[6].setOnClickListener(this)
ncArr[7].setOnClickListener(this)
ncArr[8].setOnClickListener(this)
xBitmap = BitmapFactory.decodeResource(resources, R.drawable.x)
oBitmap = BitmapFactory.decodeResource(resources, R.drawable.o)
intArr = IntArray(9)
for (i in 0..8) {
intArr[i] = 0
}
btnMenu = findViewById(R.id.btnMenu) as Button
btnStartGame = findViewById(R.id.btnStartGame) as Button
btnMenu.setOnClickListener(this)
btnStartGame.setOnClickListener(this)
stop = false
gameMode = intent.getIntExtra("game_mode", 1)
umove = 1
}
in line ncArr = arrayOfNulls(9)
There are errors:

I trying to fix this problem but i don't have more ideas...
Any sollution?
thanks in advance