A third-party library can save weeks of development, but every dependency adds code, initialisation, permissions, updates and compatibility risk. The problem does not start when the SDK is added; it starts a year later, when the team no longer remembers why it was added, who owns it, or whether it is used at all.

In projects we take over from other teams, a dependency audit almost always uncovers several SDKs that duplicate each other, or libraries reduced to a single call. Below we look at how dependencies affect speed and stability, what the public Zomato and Josh case studies show, and how to run an audit that produces a measurable result.

How dependencies affect the experience

An SDK may start before the first screen, make network requests, increase package size or compete for CPU at the most sensitive moment of a session. Even a feature users will see a few minutes later, or never, can slow down the start of every launch.

On Android, many libraries initialise automatically through a ContentProvider, before Application.onCreate is even called. Developers may not realise someone else's code is already running. On iOS, dynamic frameworks have a similar effect: each extra framework adds work for the loader before the first frame.

  • Startup: synchronous initialisation, reading configuration from disk, network calls.
  • Size: the SDK's own code plus its transitive dependencies.
  • Stability: crashes inside third-party code, version conflicts, incompatibility with a new OS.
  • Privacy and security: data collection the team is unaware of, vulnerabilities in outdated versions.
  • Store review: App Store and Google Play data disclosure requirements also apply to third-party SDKs.

What the Zomato and Josh cases show

In the Zomato case study on Android Developers, the team used Perfetto to trace every SDK initialised during startup and identify which could be removed or loaded lazily. Removing legacy SDKs and unused third-party libraries was the top priority because it was low effort and high gain.

Action in the Zomato caseBefore, sAfter, sImprovement
Removed legacy SDKs and unused libraries4.8733.81321.74%
Lazy loading of libraries3.8143.5776.2%
Layout improvements and ViewStubs2.5292.3487.15%

The Facebook login SDK is a telling example. Zomato users had other sign-in options, so initialising it on every start was wasteful. After moving to the App Startup library, the SDK loads only when someone chooses Facebook login, which cut startup time by about 6%.

In its case study, the Josh team also investigated the impact of third-party SDKs on startup, disabled auto-start for some of them and removed legacy libraries. Both examples confirm the same approach: remove obvious overhead first, then tackle more complex optimisations.

A practical dependency audit

  1. Build a complete register. Print the dependency tree (the Gradle dependencies task on Android, Package.resolved or Podfile.lock on iOS) and record direct and transitive libraries.
  2. Assign an owner to each SDK. A person or team responsible for updates, configuration and the decision to remove it.
  3. Write down the business reason. What problem the dependency solves and how you will know it is no longer needed.
  4. Check actual usage. Searching for calls often shows that a single utility is all that is used from a large library.
  5. Measure its contribution. Size in the package, initialisation time in the startup trace, network requests, share of crashes in Crashlytics or a similar tool.
  6. Make a decision. Keep it, initialise it lazily, replace it with a lighter alternative or remove it.
  7. Lock in a policy. A new dependency is added only with a short description in the pull request: why, how heavy, who owns it.

When to write your own and when to keep a library

Not every library should be replaced with custom code. Cryptography, payments, the networking stack or image loading are better left to proven, actively maintained solutions: a home-grown replacement is often more expensive and less reliable. The decision should weigh security, support, licence and the cost of the alternative.

On the other hand, wrappers around one or two platform functions, outdated utilities long covered by the Kotlin or Swift standard library, and duplicate analytics SDKs are the first candidates for removal. An unowned dependency with no measurable value quickly becomes technical debt.

Before adding a new library, we ask a few simple questions: when was the last release, how many open issues report crashes, does it support current iOS and Android versions, what is its licence, and can we drop it without rewriting half the app? If two or three of these have no confident answer, it is better to isolate the SDK behind your own interface so that a future replacement touches a single module.

Take store requirements into account too. Apple requires a privacy manifest and signature for commonly used third-party SDKs on its list, and Google Play asks you to disclose in Data safety the data collected by third-party libraries. The fewer SDKs you have, the easier it is to meet these requirements.

Common mistakes

  • Adding an SDK "for the future". The library was added for a feature that never shipped, but its initialisation stayed.
  • Several tools for one job. Two or three analytics SDKs at once, each with its own initialisation and network traffic.
  • Updating only under pressure. The team updates dependencies only when a new OS version breaks the build.
  • Blind trust in auto-initialisation. Nobody checked what the SDK actually does at startup.
  • Removing without measuring. Without a before-and-after trace, it is unclear whether the change had any effect.

We wrote more about the impact of dependencies on package size in how to reduce mobile app size, and a full breakdown of Zomato's startup work is in our piece on speed and user retention.

Team checklist

  • There is an up-to-date register of all SDKs with an owner and a business reason.
  • You know which SDKs initialise before the first frame, and each one has a justification.
  • Non-critical libraries initialise lazily or after the first screen.
  • Duplicate tools have been removed, leaving one per job.
  • Dependencies are updated on a schedule, not only during emergencies.
  • A new dependency is added via a pull request describing its weight, reason and owner.
  • The privacy manifest and Data safety form match the actual set of SDKs.

Sources: Android Developers: Zomato app speed case study; Android Developers: Josh startup performance case study; Android Developers: App Startup; Apple: Third-party SDK requirements.