Skip to content
This repository has been archived by the owner on Jul 2, 2021. It is now read-only.

Proguard rules are affecting the whole project #279

Closed
ahmounir opened this issue Jun 7, 2021 · 1 comment · Fixed by #283
Closed

Proguard rules are affecting the whole project #279

ahmounir opened this issue Jun 7, 2021 · 1 comment · Fixed by #283

Comments

@ahmounir
Copy link

ahmounir commented Jun 7, 2021

I use Dexter in my project, I enabled Proguard to minimize code size , I had a lot of problems, I wanted to see the file names that cause the problems , but this line in Proguard configuration file proguard-rules.pro :
-renamesourcefileattribute SourceFile
is overriding the whole project configuration , and hides source files names, it should be removed so I can decide if I want to hide source files names for whole project or not

Expected behaviour

I want to show source file names in crash stack trace , so I can fix the problem
Source file names should be visible if I added -keepattributes SourceFile,LineNumberTable

Actual behaviour

All file names are hidden like below :
java.lang.NullPointerException: station.name must not be null at com.myapp.o.k(SourceFile:7) at com.myapp.g$e.U(SourceFile:286) at com.myapp.g.D(SourceFile:173) at androidx.recyclerview.widget.RecyclerView$h.E(SourceFile:7254) at androidx.recyclerview.widget.RecyclerView$h.i(SourceFile:7337) at androidx.recyclerview.widget.RecyclerView$x.I(SourceFile:6194) at androidx.recyclerview.widget.RecyclerView$x.J(SourceFile:6460) at androidx.recyclerview.widget.RecyclerView$x.q(SourceFile:6300) at androidx.recyclerview.widget.RecyclerView$x.p(SourceFile:6296)

Steps to reproduce

enable proguard for a project that uses Dexter as a dependency
add -keepattributes SourceFile,LineNumberTable to keep the source file names visible in stack trace
it will not be visible because Dexter Proguard rules override SourceFile directive

Version of the library

Since 4.1.1 to 6.2.2

@pedrovgs
Copy link
Contributor

pedrovgs commented Jul 1, 2021

You are absolutely right @ahmounir our proguard configuration should not contain that line. I'm sending a PR with the fix. Thank you so much.

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

Successfully merging a pull request may close this issue.

2 participants