If there's one thing sure to ruin your day, it's a crashing smartphone. Even worse if the bug proves so bad that your phone eventually insists you do a factory reset, losing data in the process. This is exactly the situation that has befallen a number of Nexus and Pixel owners in recent days, and it's all to do with an adaptive icon bug that was discovered by the developer of third-party Facebook wrapper called Swipe.

According to app reviews on the Play Store, version 7.2 of Swipe for Facebook would cause phones running Oreo to crash and potentially spiral into a bootloop. Luckily, the developer of the app has been able to figure out the problem and has since released a fixed 7.21 update. Jcbsera has also posted a lengthy explainer on Reddit that will hopefully help other devs avoid triggering the bug in the future.

Bleeping Computer also has an article outlining the issue in simple terms, and I'll give you the gist here. The bug arose when the developer added an adaptive icon to the app, with the foreground image file and XML file named the same (ic_launcher_main.png and ic_launcher_main.xml). This would cause the phone's launcher to crash continually. The developer tested the update on an emulator, but the bug could only be recreated on a real device, so it slipped through the net.

The circular reference that was created would make any launcher that supports adaptive icons crash, and eventually lead to a more serious SystemUI failure. This would force the phone to reboot itself over and over, and all without even opening Swipe for Facebook. The only recourse was to uninstall the app via adb or do a factory reset. Thankfully the latest update to the app ensures this can no longer happen.

Jcbsera has been in touch with a dev at Google so that they can address the problem, and had this to say about their conversation:

The issue has been acknowledged and the dev I'm in contact with mentioned that this is now slated to be fixed for Android 8.1 Oreo. Hoping there is also an update to the Pixel Launcher (and other launchers) to see if this can be hot-fixed in code, if that's even possible app-side.

It's a pretty unfortunate situation all round, but it's good to see the developer be so open about what happened and try to help others avoid the same pitfall. That Google has committed to fixing the issue that caused the bug is even better news. It's kind of crazy that this could even happen at all, but that's the way it goes in the treacherous world of Android app development sometimes.

UPDATE: 2017/11/06 4:33am PST BY

Added to Google Issue Tracker

The Swipe for Facebook Developer also submitted the bug to the AOSP issue tracker, where you can track its progress. Google has said that a fix is on the way.

UPDATE: 2017/11/09 12:17pm PST BY

Google has fixed the bug, and the fix will be included in Android Studio 3.0.1 and 3.1.

sp...@google.com <sp...@google.com>Nov 7, 2017 05:33PM

Marked as Fixed, Reassigned to sp...@google.com

sp...@google.com <sp...@google.com> #11 Nov 9, 2017 12:27PM

The additional check in the New Image Asset wizard will be included in AS 3.0.1 and in AS 3.1 Canary 3.

Source: Bleeping Computer, Reddit, Pixel User Community, crash log, Issue tracker

Thanks: Sean Harvey, Stanley