at-internet / atinternet-android-sdk

AT Internet mobile analytics solution for Android
http://www.atinternet.com/
MIT License
9 stars 10 forks source link

AAR contains unnecessary resources #33

Open SimonMarquis opened 2 years ago

SimonMarquis commented 2 years ago

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

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 commented 2 years ago

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",
        )
    }
}