java.lang.AbstractMethodError: abstract method "void com.symbol.emdk.EMDKManager$EMDKListener.onOpened(com.symbol.emdk.EMDKManager)"

E Efkan YILMAZ 1 year 11 months ago
118 4 1

Hi, when tring to use EMDKManager.getEMDKManager(applicationContext,this) i get java.lang.AbstractMethodError: abstract method "void com.symbol.emdk.EMDKManager$EMDKListener.onOpened(com.symbol.emdk.EMDKManager)"
and full errror mesage in attachments

Please Register or Login to post a reply

4 Replies

M Michael Buelow

Hey,

I just had the same problem while developing a Flutter-Plugin for a Flutter app. The problem occurred only when building for release mode. Turns out gradle removes unused classes/functions in libraries when building for release. And I think them EMDK uses reflection to find the EMDKListener and the onOpenend-Method. Reflection is something gradle cannot take into account when building. That's why gradle thinks these classes are unused and simply strips them from the release app.

To prevent gradle from removing your classes you can annotate them with @Keep. See here for more information https://developer.android.com/reference/androidx/annotation/Keep.

Hope this helps.

Kind regards
Michael

J Jose Georges

I'm using a Wrapper to access the serial number through the EMDK https://github.com/ltrudu/DeviceIdentifiersWrapper

I'm encountering the exact same issue. Which class/package should I add to proguard to get it running in release? I tried 

-keep class com.symbol.emdk.* { *; }
-keep class com.github.ltrudu.* { *; }

 

but doesn't seem to work

N Niclas Lindgren

Absolutely amazing sir. You deserve a medal for this. I spent probably 1-2 weeks on this problem now. It worked fine in debug mode while it did not work at all in release....

Annotating with @Keep solved it. Thank you very much!

J Jose Georges

I'm using a Wrapper to access the serial number through the EMDK https://github.com/ltrudu/DeviceIdentifiersWrapper

I'm encountering the exact same issue. Which class/package should I add to proguard to get it running in release? I tried 

-keep class com.symbol.emdk.* { *; }
-keep class com.github.ltrudu.* { *; }

 

but doesn't seem to work

CONTACT
Can’t find what you’re looking for?