How to get USB file transfer working on Oreo 8.1?
Go into Developer options, scroll down to "Select USB Configuration" and select MTP ( Media Transfer Protocol ) even if it's already selected.

This solved the problem for me.