android - java.lang.NoClassDefFoundError Proguard - unable to resolve virtual method -


in main class in application i'm handling api variations programmatically:

    private static bluetoothheadset mbluetoothheadset;  // later in code      if (build.version.sdk_int >= build.version_codes.honeycomb) {      mbluetoothheadset = proxy;      } 

i assumed noclassdeffounderror caused because declaring variable bluetoothheadset api 11, app available api 9. thinking being clever , not directly referencing missing class, therefore parameterized it:

    private static object mbluetoothheadset;  // later in code      if (build.version.sdk_int >= build.version_codes.honeycomb) {      mbluetoothheadset = (bluetoothheadset) proxy;      } 

but didn't work , i'm wondering if proguard obfuscation culprit:

could not find class 'com.package.name.qc', referenced method com.package.name.example.<init>  vfy: unable resolve virtual method 435: landroid/bluetooth/bluetoothheadset;.startvoicerecognition (landroid/bluetooth/bluetoothdevice;)z 

during obsfucation, proguard mapping bluetoothheadset class won't found on api level 9?

i deal many other api variations in way , have never had issue before, i'm confused why it's happening in these circumstances? perhaps it's due variable declaration i'm using?

i really, don't want have create separate classes each api level, cause many duplications in code , in opinion, harder manage.

i thank in advance , hope can help.

edit - i've found in eyes free source code they've implemented own bluetoothheadsetcompat class using reflection, assume how getting around problem. doesn't straight forward though, whilst trawl through code, other suggestions welcome!


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -