Execution failed for task ':camera:compileDebugJavaWithJavac'

Solution 1:

Try updating your compileSdkVersion and targetSdkVersion to 31.