Stippl is the social AI travel planner. Our Android ANR reports showed the app freezing at startup in code that runs before ours: Firebase starting its SDKs and Mapbox loading its map library. We stopped an alarm that started the app every 15 minutes, removed an SDK nobody called and made the map library load only when a map opens. The startup freezes went to zero with the alarm, one build before the rest.
Between 10 October and 9 November, Google Play logged an Android ANR for 408 travellers using Stippl. For 67 of them, 16%, the app froze inside Firebase's own start, before our application class ran and before any of our JavaScript had loaded. One of the SDKs it was busy starting was one we had never called.
This is how we found where that startup time went, what we took out, the fix that hung our splash screen for 32 seconds before it reached anyone, and why the number that moved most came from the change I thought was the easy part.
Before our first line
ANR stands for Application Not Responding. The app's main thread stayed blocked long enough that Android stopped waiting, and on a start in front of you it offers to close the app. Google Play counts them per app and shows apps with too many to fewer people. Play only counts phones that share diagnostics, so every number here is a sample, not everyone.
Our startup freezes were not new: they were there at about the same level in every build we checked, back to 3.1.5. They were the cost of starting the app at all.
We read the traces through Play's Developer Reporting API, which returns the full stack of each sampled report instead of one blamed line. On 3.1.11, three families made up most of what was left: Firebase starting up (19% of the travellers with an ANR), the Mapbox map library loading (15%), and our own MainApplication.onCreate (13%).
The first two never reach our code. When Android starts a process, it binds the application and runs every content provider the merged manifest declares, before Application.onCreate. SDKs use that hook to start themselves: Firebase through FirebaseInitProvider, Mapbox through Jetpack's androidx.startup. It runs in every process start, also the ones nobody sees, like a push arriving with the app closed.

What runs before our first line
Everything above our application class is code we did not write and, in one case, never called. On a slow phone, its sum is the freeze. And it is paid at every process start, so the other question is how often the app starts.
Starting the app less often
The first fix was in our own code, and it shipped first, in 3.1.13. Our journal syncs photos in the background with a task that Android runs from an alarm every 15 minutes, and every start of the app registered it, for every traveller. When the app was not running, each alarm was a full process start: Firebase, Mapbox's library, our application class and a JavaScript runtime with no screen, for a sync that almost never had anything to do. Between 10 October and 6 November, 134 of our 498 Android ANR reports, 27%, came from those wakes.
Now the task exists only while a journal entry is waiting to sync. A check at every start, and at the end of every sync, registers it when something waits and removes it when nothing does. Android keeps the alarm across an app update, so an install that had it loses it on its first start of the new build, or on the alarm's first wake after the update. Photos added just before the app closes still get the alarm, and the sync also runs when the app starts, comes to the front or signs in.
I filed this as the easy part: background noise to clear away before the real work on startup. The numbers further down say otherwise.
The SDK nobody called
No single Firebase call was slow. In each trace, the main thread was busy in the next SDK's start component: Sessions, Crashlytics and its native crash loader, component discovery, Auth, the Analytics connector, Performance Monitoring. Together they were too slow for a slow phone.
Most of those carry weight. They give us push, sign in, crash reports, analytics and remote config, and making them lazy would mean patching Firebase. So I asked a smaller question: which of them do we use?
Performance Monitoring came in as a dependency in June 2024, and no JavaScript has called it since. A search of the whole repository found it in three places: the package list, its config plugin and an iOS linking list. No import, no wrapper, no firebase.perf(). Our own documentation said we used it. It still showed up in 8 of the 61 Firebase traces.
Switching collection off would not have helped. Its early component, FirebasePerfEarly, ran at every start with firebase_performance_collection_enabled set to false. So the module had to leave the Android build: one entry in package.json, expo.autolinking.android.exclude: ["@react-native-firebase/perf"], and the config plugin that applied its Gradle plugin removed. A test named "Firebase Performance on Android is not autolinked and its Gradle plugin is not applied" fails if either comes back.
The measured win is small, and I would rather say so. On the emulator, Firebase's time on the main thread at start went from 66 ms to 61 ms, the middle value of seven starts before and six after, and Performance's own share from 6.6 ms to zero. With the host under heavy load, that one component took 125 of 688 ms. I expect it to take about an eighth off the Firebase family, not to end it. The rest of Firebase stays on the main thread until we can move its start without racing every SDK that needs it.
What we gave up is the Android data in the Firebase Performance console, which nothing read. Android startup and screen timings still reach us through Sentry.
Loading the map when a map opens
Mapbox draws the trip map in our itinerary planner, and it was the second family. In Crashlytics it was one kind of phone: 26 freezes from 25 travellers between 25 October and 8 November, every one a Xiaomi on Android 16. The traces showed Mapbox's startup initializer loading its native library, System.loadLibrary("mapbox-maps"), on the main thread. Every process start paid for a map, including a push arriving with the app closed.
The fix looked small. A config plugin removes Mapbox's two startup initializers from the merged manifest with tools:node="remove", and the access token is set when the first map renders instead of when the module is imported. When the startup hook has not run, Mapbox's classes take a lazy path and initialise on first use. We had read that in its bytecode.
The fix that hung the splash
The first Android test build with it never got past the splash screen. On the emulator, am start -W gave up after 32 seconds.
One class did not take the lazy path. LocationServiceImpl reads Mapbox's common context in its static initializer, and the only code that set that context was the startup hook we had just removed. Our map library creates its location module as soon as the JavaScript bundle imports the library. So the import threw, React Native never registered the app, and the splash stayed.

Where the hang came from
Putting the initializer back would have brought back half of the freeze. Instead, one line in the patch we already keep for the map library sets the context when its location manager starts: MapboxSDKCommon.invoke(context.applicationContext). It is a static field write, with no native load. With it, the same build started cold in 2.4 seconds, then 1.9 and 1.7. A build of the same commit without the patch hung the same way, so the patch is what fixed it.
Now the common library loads on a background thread when the JavaScript starts, the map library loads on the main thread when the first map opens, and a start with no screen, like a push, loads neither. The test build caught the hang, and no traveller saw it.
The numbers after
3.1.14 has been on Google Play since 14 November. Play's data runs about two days behind, so what I have is its first four days, 15 to 18 November. A traveller day is one phone using the app on one day. For each build I sorted Play's ANR reports by what the main thread was doing, and counted them over the days that build was in use: 3.1.11 from 29 October to 10 November, 3.1.13 from 8 to 18 November, 3.1.14 from 15 to 18 November. So the columns measure the same thing.

Startup freezes, build by build
The startup freezes were gone a build before the fixes most of this article is about. 3.1.13 changed one thing about how the app starts: the alarm. Firebase was the same as in 3.1.11, and yet from 8 to 18 November not one report froze in Firebase's start or in our application class, where the 3.1.11 rate predicts about 46. Three of the four Mapbox freezes left on 3.1.13 came from the alarm itself, on phones where the update had not removed it yet.
3.1.14 keeps all of it at zero in its first four days, and none of its three ANR reports has a Firebase Performance frame. Sentry, our second source, shows the same drop in ANR events of every kind: 69 on 3.1.11, 5 on 3.1.13 and 3 on 3.1.14 so far.
So I cannot tell you yet what the SDK we removed and the lazy map add on top. On these numbers, starting the app less often did most of the work. Why it also took away freezes on starts a traveller made by tapping the icon, I can only partly explain: a tap that lands on a process the alarm is still starting waits behind that start. Whether that is all of it, the data does not say. I will add two full weeks of 3.1.14 at the end of November.
For scale: Play's 7 day ANR rate, the one the store ranks on, was 0.15% on 13 November, the last day before 3.1.14, and 0.07% on 17 November. It had peaked at 0.84% on 3 November for another reason, an animation library writing full stack traces on the main thread, fixed in 3.1.11.
What I would do differently
Three things.
I would look at how often the app starts before how long each start takes. I treated the alarm as noise to clear before the real work and went after the SDKs. The numbers put it the other way round. What lets me say so is that the two went out in separate builds, a week apart. Had they shipped together, this table would have credited the SDKs.
I would list what starts itself before adding anything to the app, and keep that list under test. The merged manifest says exactly which content providers and startup initializers run. Nothing told us when that list grew. We now test that Performance Monitoring does not come back; we do not yet test the whole list.
And I would not merge a startup change that has only been read. The plan was right, and the reading was right for every Mapbox class but one. Our own notes on the first fix said "read in the bytecode, not run yet". That sentence was the risk, written down. Here it cost a test build and about a day. In a store build it would have been every Android traveller who updated, stuck on the splash.
The takeaway
A dependency nobody calls is still code that runs at start, and every start pays for it. So first count how often your app starts when nobody asked it to, and stop those starts. Then read what starts itself before your first line does and remove what you do not use. And start a release build on a real device before you trust the lazy path that replaces it.
I filed the alarm as the easy part. The numbers say it did most of the work.Robin, CTO of Stippl
Questions people ask
What causes ANRs at Android app startup?
Work on the main thread before the first screen. SDKs that start themselves through a content provider or androidx.startup run in every process start, before Application.onCreate, also in background starts nobody sees, and on a slow phone their sum is enough for Android to report the app as not responding.
Does switching off Firebase Performance Monitoring stop its startup work on Android?
Not in our build. Its early component ran at every start with collection switched off, so we removed the module from the Android build instead.
How do you make the Mapbox SDK load lazily on Android?
Remove its two androidx.startup initializers from the merged manifest and set the access token when the first map renders. Any Mapbox class that reads its common context before that needs the context set first, or the app can hang at start.
Stippl is the social AI travel planner. Travellers describe a trip in their own words, the AI builds the plan, and the people they travel with join to plan, book and share it together. More than 1.5 million travellers have planned their trips with Stippl. It is free on iOS, Android and the web.



