I tried to write a minimal version and it works fine for me. Could you try it?
Include the Camera permission in AndroidManifest
To check log:
Let me know if this works for you. If so, we can dig deeper into the diff between your code and this.
BTW, where did you see the problematic code example on line 27: . That doc need to be fixed.