The code that automatically detects permissions in the code reports an error: permission in Manifes, reports unresolved reference: permission error
The correct code is as follows:
if(ContextCompat.checkSelfPermission(this,android.Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED){
ActivityCompat.requestPermissions(this,arrayOf(android.Manifest.permisson.READ_EXTERNAL_STORAGE),0)
}