Search code examples
androidlayoutproguardandroidplot

ProGuard destroyed my Androidplot Layout


I'm fairly new to android development and I know decided to give ProGuard a go.

After struggling with thousands of warnings, I managed to get a stable version of my app which does exactly what it's supposed to do.

So the only problem left is that Proguard completely destroys the layout of my androidplot.

I don't really know how to fix it and i didn't really find a similar problem online.

Any kind of tips are appreciated, as i don't even know where I should start to search for the Problem.

Here are two Screenshots (before and after ProGuard):

enter image description here enter image description here

----- UPDATE: -----

For everyone who might come across the same Issue:

I still don't know what exactly caused the problem but updating from Androidplot v1.1.0 to v1.4.1 did the trick for me.


Solution

  • Cedric's answer is the right one, but given your comment on his solution it sounds like maybe your custom proguard rules arent getting picked up at all.

    Depending on your project structure etc. (I'd assume you're using gradle with a recent SDK version) there might be different things going on. A couple things to check:

    • Make sure your proguard config (usually proguard-rules.pro) is in the correct location. (usually the project root)
    • Check your build.gradle to ensure that it's including your proguard config.

    Usually something like this:

    android {
      buildTypes {
        release {
          minifyEnabled true
          proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
        }
      }
      ...
    }
    

    NOTE: If you've enabling obfuscation for dev builds, you'll need to add the same thing for your dev build profile as well.