Front camera not working on OnePlus 5T
Tried to fix a possible software problem in any way I could imagine. Nothing worked.

Sent it to OnePlus for repairing and now it is working like new. They had to replace a few components, so it was a hardware problem.