It's not the problem with version ... You can do it by following the steps below
Settings > LockScreen & Security > Other Security Settings > Device administrators
Then Keep the switch to ON for AppLock. This should work.
ofcourse the path depends on your mobile but your moto should be to...