mvallim / emv-qrcode

Java Based EMV QR Code Generator and Parser (MPM, CPM)
https://mvallim.github.io/emv-qrcode/
Apache License 2.0
95 stars 46 forks source link

NoSuchMethodException when using proguard #48

Closed ZakariaJawas closed 1 year ago

ZakariaJawas commented 1 year ago

Describe the bug I got java.lang.NoSuchMethodException: com.emv.qrcode.decoder.mpm.MerchantPresentedModeDecoder. when usign proguard while decoding the qr string I already tried to exclude the library classes in proguard rules -keep class com.emv.qrcode.model.mpm.** {*;} but it is not working.

To Reproduce Steps to reproduce the behavior:

  1. Go to app build.gradle
  2. adding the debug buildTypes minifyEnabled true shrinkResources true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'

Expected behavior Decoded QR string successfully

Smartphone (please complete the following information):

Additional context Note: when not using proguard shrinking resource feature it works

ZakariaJawas commented 1 year ago

Issue was solved by adding -keep class com.emv.qrcode.decoder.mpm.** {*;} to proguard rules