I tried this sample some monthes ago (guess, it was B4A 7.8) and tried now (B4A 8.30)
No problems with compilation.
Camera2 is enough complex, for my app I used intents. But this is another story.
You use Java 8 instead of Java 10. Doubt that this is important here.
Try to update everything in SDK manager and check android.jar path (better to set to android-27).