Kotlin – reference no resuelta por constante

Estoy intentando usar el código de muestra de la nueva API de hardware de la camera (android.hardware.camera2) para mi aplicación de Android. Primero, convertí el código de Java al código de Kotlin mediante la function de conversión automática del complemento de Kotlin para Android Studio. A continuación se muestra una parte del código convertido:

private val mCaptureCallback = object : CameraCaptureSession.CaptureCallback() { private fun process(result: CaptureResult) { when (mState) { STATE_PREVIEW -> { }// We have nothing to do when the camera preview is working normally. STATE_WAITING_LOCK -> { val afState = result.get(CaptureResult.CONTROL_AF_STATE) if (CaptureResult.CONTROL_AF_STATE_FOCUSED_LOCKED == afState || CaptureResult.CONTROL_AF_STATE_NOT_FOCUSED_LOCKED == afState) { // CONTROL_AE_STATE can be null on some devices val aeState = result.get<Int>(CaptureResult.CONTROL_AE_STATE) if (aeState == null || aeState == CaptureResult.CONTROL_AE_STATE_CONVERGED) { mState = STATE_WAITING_NON_PRECAPTURE captureStillPicture() } else { runPrecaptureSequence() } } } STATE_WAITING_PRECAPTURE -> { // CONTROL_AE_STATE can be null on some devices val aeState = result.get<Int>(CaptureResult.CONTROL_AE_STATE) if (aeState == null || aeState == CaptureResult.CONTROL_AE_STATE_PRECAPTURE || aeState == CaptureRequest.CONTROL_AE_STATE_FLASH_REQUIRED) { mState = STATE_WAITING_NON_PRECAPTURE } } STATE_WAITING_NON_PRECAPTURE -> { // CONTROL_AE_STATE can be null on some devices val aeState = result.get<Int>(CaptureResult.CONTROL_AE_STATE) if (aeState == null || aeState != CaptureResult.CONTROL_AE_STATE_PRECAPTURE) { mState = STATE_PICTURE_TAKEN captureStillPicture() } } } } 

Obtengo el error de reference no resuelto para:

 CaptureResult.CONTROL_AF_STATE_FOCUSED_LOCKED CaptureResult.CONTROL_AF_STATE_NOT_FOCUSED_LOCKED CaptureResult.CONTROL_AE_STATE_CONVERGED CaptureResult.CONTROL_AE_STATE_PRECAPTURE CaptureRequest.CONTROL_AE_STATE_FLASH_REQUIRED 

Pero estas constantes se reconocen en el código original de Java. Hay alguna solución para estos errores?