android keeps on restarting with optimizing apps


Question

Problem:


It constantly restarts with optimizing apps.


Some Background:



  • This phone was running on low disk space some days back, which I
    resolved by removing unwanted files.

  • Some apps are third party apps installed by downloading from websites.

  • I have searched other threads and none seems to be solving my issue.

  • I have done a "cache wipe" as well, which didn't solve the issue.

  • This has android version 6.

  • I am able to run Fastboot and have access to Fill-Z touch recovery.

  • I obviously don't want to format (easy solution) this phone as that
    would delete all the data in there.


Extra resource:


vimeo link describing problem


If anyone can let me know how can I disable this "Optimizing app" before the start, I'd be glad.
Any help would be appreciated. Thanks in advance!


Answer

I had a similar issue not that long ago: the culprit seems to be some app ART cannot compile for some reason. As you successfully applied my solution and confirmed, let me sum up the facts from the comments in an answer:



1. figure which app is the culprit.



On each of those crashes, the Android system sets a "tombstone" on the "grave" of the dying process – something known on Unix/Linux systems as Core Dump. Those core dumps are placed into /data/tombstones, with at maximum 10 files kept (after that, the oldest one will be overwritten on the next occasion). So we need to look to those tombstones to see whats written on them. As you have a custom recovery which offers access, the easiest way is:




  1. adb pull /data/tombstones tombstones (will copy the entire directory to your computer)

  2. use a viewer/editor of your choice (best one you are familiar with) to open and investigate each of the tombstones, starting with the newest and walking back.

  3. look into the "stack trace" to see if an app (or it's path in /data/data) is mentioned there. If so, note it. If it's the same app in the next tombstone and the one after, you can be pretty sure this is the case we're describing here.



2. put the "obstacle" out of ART's way



Having identified the app, we need to remove it so doesn't get stuck with it. For this, again we need adb shell with its prompt – and the directory name from our tombstones:



rm -rf /data/data/<whateveritwas>


Note this removes all the data of the app as well – so having a backup in advance might be a good idea (in the current state: either adb pull the directory, or do a backup you can analyze later).



That done, reboot. Now "optimizing apps" should finish successfully.



Alternatives to the command-line approach



Some custom recoveries ship with an integrated file manager, usually called "Aroma". Above steps could also be perfomed with that:




  • navigate to /data/tombstones

  • view the tombstones

  • navigate to /data/data and remove the offender


Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes