Using EMDK in Cordova Plugin

How can I use the emdk api within a cordova plugin?

I added com.symbol.jar to the lib folder of my plugin:

 

<?xml version="1.0" encoding="UTF-8"?> <plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"     id="com.dff.cordova.plugins.powermanager"     version="0.0.1">     <name>PowerManager</name>     <description>PowerManager Plugin</description>     <keywords>phonegap,cordova,PowerManager,dff</keywords>       <js-module src="www/powermanager.js" name="powermanager">         <clobbers target="PowerManger" />     </js-module>      <!-- android -->     <platform name="android">         <config-file target="res/xml/config.xml" parent="/*">             <feature name="PowerManager">                 <param name="android-package" value="com.dff.cordova.plugin.powermanager.PowerManagerPlugin"/>                 <!-- param name="onload" value="true" / -->             </feature>         </config-file>                 <config-file target="AndroidManifest.xml" parent="/*">             <uses-permission android:name="android.permission.REBOOT" />             <uses-permission android:name="com.symbol.emdk.permission.EMDK"/>         </config-file>                 <config-file target="AndroidManifest.xml" parent="/manifest/application">             <uses-library android:name="com.symbol.emdk"/>         </config-file>           <!-- framework src="addon-symbol-emdk_v3.1_API-19/libs/com.symbol.emdk.jar" / -->                 <resource-file src="assets/EMDKConfig.xml" target="assets/EMDKConfig.xml" />         <source-file src="lib/com.symbol.emdk.jar" target-dir="libs" />         <source-file src="src/android/com/dff/cordova/plugin/powermanager/PowerManagerPlugin.java" target-dir="src/com/dff/cordova/plugin/powermanager" />              </platform> </plugin>

 

Then building an apk works fine. But when the plugin is executed the following error is thrown:

 

06-22 16:22:07.639: W/dalvikvm(8575): Class resolved by unexpected DEX: Lcom/dff/cordova/plugin/powermanager/PowerManagerPlugin;(0x419475c0):0x5b666000 ref [Lcom/symbol/emdk/EMDKManager$EMDKListener;] Lcom/symbol/emdk/EMDKManager$EMDKListener;(0x419475c0):0x5b625000 06-22 16:22:07.639: W/dalvikvm(8575): (Lcom/dff/cordova/plugin/powermanager/PowerManagerPlugin; had used a different Lcom/symbol/emdk/EMDKManager$EMDKListener; during pre-verification) 06-22 16:22:07.639: I/dalvikvm(8575): Failed resolving Lcom/dff/cordova/plugin/powermanager/PowerManagerPlugin; interface 706 'Lcom/symbol/emdk/EMDKManager$EMDKListener;' 06-22 16:22:07.639: W/dalvikvm(8575): Link of class 'Lcom/dff/cordova/plugin/powermanager/PowerManagerPlugin;' failed 06-22 16:22:07.639: W/System.err(8575): java.lang.ClassNotFoundException: com.dff.cordova.plugin.powermanager.PowerManagerPlugin 06-22 16:22:07.639: W/System.err(8575): at java.lang.Class.classForName(Native Method) 06-22 16:22:07.649: W/System.err(8575): at java.lang.Class.forName(Class.java:251) 06-22 16:22:07.649: W/System.err(8575): at java.lang.Class.forName(Class.java:216) 06-22 16:22:07.649: W/System.err(8575): at org.apache.cordova.PluginManager.instantiatePlugin(PluginManager.java:487) 06-22 16:22:07.649: W/System.err(8575): at org.apache.cordova.PluginManager.getPlugin(PluginManager.java:167) 06-22 16:22:07.659: W/System.err(8575): at org.apache.cordova.PluginManager.exec(PluginManager.java:120) 06-22 16:22:07.659: W/System.err(8575): at org.apache.cordova.CordovaBridge.jsExec(CordovaBridge.java:59) 06-22 16:22:07.659: W/System.err(8575): at org.apache.cordova.engine.SystemExposedJsApi.exec(SystemExposedJsApi.java:41) 06-22 16:22:07.659: W/System.err(8575): at com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method) 06-22 16:22:07.659: W/System.err(8575): at com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:24)06-22 16:22:07.659: W/System.err(8575): at android.os.Handler.dispatchMessage(Handler.java:102) 06-22 16:22:07.659: W/System.err(8575): at android.os.Looper.loop(Looper.java:136) 06-22 16:22:07.659: W/System.err(8575): at android.os.HandlerThread.run(HandlerThread.java:61) 06-22 16:22:07.669: W/System.err(8575): Caused by: java.lang.NoClassDefFoundError: com/dff/cordova/plugin/powermanager/PowerManagerPlugin

 

Is there a way to include com.symbol.jar for compiling but not for dexing?