ITECOMMPAY / mobile-sdk-android-ui

8 stars 2 forks source link

Add ProGuard files to MSDK #5

Closed savelyevdm closed 2 weeks ago

savelyevdm commented 1 month ago

Hi!

I has passed more than year since one of your clients faced an issue with your library after minification: https://github.com/ITECOMMPAY/mobile-sdk-android-ui/issues/4 But there are still no rules in 3.6.1 and our app crashed today after building a release android build.

Please, be kind and provide library-specific ProGuard rules so your client's apps can be successfully build without any additional effort. Piece of Google's advice:

A library module might include its own ProGuard configuration file.

If you have a library project that you use to build and publish an AAR, you can add a ProGuard configuration file to your library's build configuration. If you do, the Android Gradle plugin applies the ProGuard rules that you have specified. The build tools embed this file within the generated AAR file for the library module. When you add the library to an app module, the library's ProGuard file is appended to the ProGuard configuration file (proguard.txt) of the app module.

By embedding a ProGuard file in your library module, you help ensure that app modules that depend on your library don't have to manually update their ProGuard files to use your library. When the Android Studio build system builds your app, it uses the directives from both the app module and the library. So there's no need to run a code shrinker on the library in a separate step.

P.S. After using rules from referenced issue - problem was solved and app successfully builds now.

AlexeyKhrameev commented 2 weeks ago

fixed at 3.6.4

savelyevdm commented 2 weeks ago

@AlexeyKhrameev Hi, Alexey! Thank you! Found new proguard rules in mobile-sdk-android-ui-ecommpay/consumer-rules.pro in 3.6.5, but they are not included in resulting AAR archiive, as are not mentioned in mobile-sdk-android-ui-ecommpay/build.gradle.kts. According to documentation I'm expecting to see smth like:

android {
    defaultConfig {
        consumerProguardFiles("lib-proguard-rules.txt")
    }
    ...
}

... in order to see progurd.txt in resulting AAR archive.

savelyevdm commented 1 week ago

@AlexeyKhrameev Thank you, in 3.6.6 issue is completely fixed 😉