0

Why does an APK include its used Android framework APIs?

I create a new empty project with Android Studio(Dolphin), enable Proguard, and build an APK. By analyzing the APK with Android Studio and jadx, I notice that APIs from the package android. appear in the APK. They don't have their implementation, and their constructor throws NoClassDefFoundError.

I thought that all framework APIs are provided by the system so that an app doesn't need to include them.

My question is:

  1. What's their usage?
  2. Can we remove them?

A chatbot mentioned minSdkVersion, but I can't find any concrete sources.

Dewey Reed
  • 4,353
  • 2
  • 27
  • 41
  • Could you please include a few examples of such APIs in your question? – Robert Mar 17 '23 at 12:54
  • @Robert `android.app.AppComponentFactory`, `android.os.LocaleList`, `android.view.WindowInsets$Builder`, etc. They all seem to be new APIs higher than the minSdk(21). – Dewey Reed Mar 18 '23 at 01:49

0 Answers0