Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AAR contains unnecessary resources #33

Open
SimonMarquis opened this issue Mar 11, 2022 · 1 comment
Open

AAR contains unnecessary resources #33

SimonMarquis opened this issue Mar 11, 2022 · 1 comment

Comments

@SimonMarquis
Copy link

Hi, the AAR artifact you provide through maven contains a lot of useless resources (around half of its size):

  • 270K of fonts that appears to be unused
  • ~50K of res/layout for debug purposes

Could you do some cleanup and/or provide release & debug variants containing only the necessary bits?

🙏 Thanks


FYI: here is a dump of Tracker-2.21.2.aar:

[603K]  .
├── [ 331]  AndroidManifest.xml
├── [ 524]  META-INF
│   └── [ 428]  com
│       └── [ 332]  android
│           └── [ 236]  build
│               └── [ 140]  gradle
│                   └── [  44]  aar-metadata.properties
├── [ 11K]  R.txt
├── [270K]  assets
│   └── [270K]  fonts
│       ├── [ 29K]  Montserrat-Bold.ttf
│       ├── [ 28K]  Montserrat-Regular.ttf
│       └── [212K]  OpenSans-Regular.ttf
├── [282K]  classes.jar
├── [  64]  drawable
├── [  64]  fonts
├── [  64]  layout
├── [  67]  proguard.txt
├── [ 39K]  res
│   ├── [ 25K]  drawable
│   │   ├── [1.4K]  adtracking48.png
│   │   ├── [4.3K]  atinternet_logo.png
│   │   ├── [ 564]  audio.png
│   │   ├── [1.8K]  back64.png
│   │   ├── [1.6K]  database64.png
│   │   ├── [ 638]  error48.png
│   │   ├── [ 399]  header_background.xml
│   │   ├── [2.0K]  info48.png
│   │   ├── [ 316]  layout_background.xml
│   │   ├── [ 322]  no_event_background.xml
│   │   ├── [1.3K]  product.png
│   │   ├── [1.8K]  refresh64.png
│   │   ├── [ 323]  save48.png
│   │   ├── [ 603]  sent48.png
│   │   ├── [1.2K]  smartphone48.png
│   │   ├── [ 842]  touch48.png
│   │   ├── [2.4K]  trash48.png
│   │   ├── [1.8K]  trash64.png
│   │   └── [ 607]  video.png
│   ├── [ 13K]  layout
│   │   ├── [ 548]  debugger_layout.xml
│   │   ├── [1.6K]  event_holder.xml
│   │   ├── [2.7K]  event_viewer_layout.xml
│   │   ├── [1.9K]  hit_detail_viewer_layout.xml
│   │   ├── [1.9K]  offline_hits_holder.xml
│   │   ├── [3.1K]  offline_hits_viewer_layout.xml
│   │   └── [ 997]  parameter_holder.xml
│   └── [ 654]  values
│       └── [ 558]  values.xml
└── [  64]  values
@SimonMarquis
Copy link
Author

The current workaround to exclude these ressources is to configure AAPT to ignore them:

android {
    androidResources {
        ignoreAssetsPatterns += listOf(
            "Montserrat-Bold.ttf",
            "Montserrat-Regular.ttf",
            "OpenSans-Regular.ttf",
        )
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant