The bug was discovered by Jcbsera, the developer of the Swipe for Facebook Android app, and does not affect Android Oreo in its default state.
The bug occurs only with apps that use adaptive icons - a new feature introduced in Android Oreo that allows icons to change shape and size based on the device where they are being viewed, or the type of launcher the user is using on his Android device. For example, adaptive icons will appear in square, rounded, or circle containers depending on the theme or launcher the user is using. The style of adaptive icons is defined a local XML file.
The bug first manifested itself when the developer of the Swipe for Facebook Android app accidentally renamed the foreground image of his adaptive icon with the same name as this XML file (ic_launcher_main.png and ic_launcher_main.xml). This naming scheme sends Android Oreo in an infinite loop that regularly crashes the device.
Android detects something is wrong and prompts the user to reset the device to factory settings. Users don't have to open an app, and the crashes still happen just by having an app with malformed adaptive icons artifacts on your phone. Google said it will fix the problem in Android Oreo 8.1.