Many users facing this problem in android device. In this condition, device showing following message when they try to change screen lock type.
You can fix this problem by several ways.
Sometimes, device administration from other apps may create above said problem. You can fix it by going to Settings > Security > Device administrators and deselect all apps (e.g. Android Device Manager, which allow Android device manager to lock or delete lost device).
If disable device administrator doesn't solve your problem then check encryption settings. To this, go to Settings > Security > Encrypt Device and input your PIN.
Last but not least, it will solve your problem definitely. Go to Settings > Security > Clear credentials. You will be asked to confirm to do this action. Click Yes and your problem will be fixed.
If this post helped you then share it with your friends.