Writing NativeScript plugin for EMDK Android

J Julian Schmidl 3 years 6 months ago
84 1 0

Hi all,
 
actually I'm trying to write a NativeScript plugin to use the native EMDK on my device (especially the hardware scanner).
I'm using the EMDK for Android v6.3. From the coding perspective (only the java code - not the GUI) I'm pretty close to this sample: Basic Scanning Tutorial using Barcode API - Zebra Technologies Techdocs
 
Unfortunately the app crashes when I'm trying to get the barcodeManager:
barcodeManager = (BarcodeManager) this.emdkManager   .getInstance(EMDKManager.FEATURE_TYPE.BARCODE);
 

 
As far as I can see the most important details from the log files are:
07-07 16:08:39.141 21367 21367 D com.symbol.emdk.EMDKServiceConnection: The EMDK Service is now connected!
07-07 16:08:39.142 20029 20029 V MDM_TASK_BASE_SERVICE: onCreate
07-07 16:08:39.145 17334 17345 D com.symbol.emdk.emdkservice.MxServiceConnection: release: The connection to the MX Service is closing...
07-07 16:08:39.146 20029 20029 V MDM_TASK_BASE_SERVICE: onCreate end
07-07 16:08:39.146 20029 20029 V MDM_TASK_BASE_SERVICE: onStartCommand, startId: 1, action:null
07-07 16:08:39.146 20029 20029 V MDM_TASK_BASE_SERVICE: onStartCommand end
07-07 16:08:39.147 20029 21455 D MDM_TASK_BASE_SERVICE: TaskBaseService handle message: SEQUENCE_INTENT
07-07 16:08:39.147 20029 21455 D MDM_TASK_BASE_SERVICE: Worker entered work method, new_task: null
07-07 16:08:39.147 20029 21455 D MDM_TASK_BASE_SERVICE: TaskBaseService loadQueue
07-07 16:08:39.148 17334 17345 D com.symbol.emdk.emdkservice.MxServiceConnection: The connection to the MX Service is closed.!
07-07 16:08:39.148 17334 17345 D SvcEMDKManager: supportedcradle is null
07-07 16:08:39.148 17334 17345 D SvcEMDKManager: supportedDiagnostic is null
07-07 16:08:39.148 17334 17345 D SvcEMDKManager: #EMDK-SVC# ProfileService::nfnUnInitialize()
07-07 16:08:39.148 17334 17345 D com.symbol.emdk.emdkservice.MxServiceConnection: MxServiceConnection constructor
07-07 16:08:39.148 17334 17345 D com.symbol.emdk.emdkservice.MxServiceConnection: Binding Mx srvice...
07-07 16:08:39.157 17334 17345 D com.symbol.emdk.emdkservice.MxServiceConnection: MX binding request sent. State: true
07-07 16:08:39.157 17334 17345 D SvcEMDKManager: getVersion - Entering
07-07 16:08:39.157 17334 17334 D com.symbol.emdk.emdkservice.MxServiceConnection: onServiceConnected: Connected to MX service...
07-07 16:08:39.157 17334 17334 D MxVersionHandler: MxVersionHandler Constructor
07-07 16:08:39.158 17334 17345 D SvcEMDKManager: getVersion - Leaving
07-07 16:08:39.158 17334 17345 D SvcEMDKManager: EMDK Version=6.3.23.623
 
07-07 16:08:39.169 21367 21367 F libc    : Fatal signal 11 (SIGSEGV), code 1, fault addr 0x7748980 in tid 21367 (tivescript.demo)
07-07 16:08:39.179  6387  7049 W Herrevad: Invalid mccmnc
07-07 16:08:39.186  6387  7049 W Herrevad: Invalid mccmnc
07-07 16:08:39.255  6387  7431 I DpmTcmClient: RegisterTcmMonitor from: com.android.okhttp.TcmIdleTimerMonitor
07-07 16:08:39.271   552   552 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
07-07 16:08:39.271   552   552 F DEBUG   : Build fingerprint: 'Zebra/TC56/TC56:6.0.1/01-15-01.7-MG-00/105:user/release-keys'
07-07 16:08:39.271   552   552 F DEBUG   : Revision: '0'
07-07 16:08:39.271   552   552 F DEBUG   : ABI: 'arm'
07-07 16:08:39.272   552   552 F DEBUG   : pid: 21367, tid: 21367, name: tivescript.demo  >>> org.nativescript.demo

Please Register or Login to post a reply

1 Replies

Y Yanis Dalabiras

Hi Julian,

Interesting, looking through the NativeScript create a plugin docs there are a few things I could suggest:
* Ensure you are including the jar file as 'provided' in your build.gradle, I do not suspect NativeScript will understand the compileSDKVersion of Symbol Technologies.  The default sample uses compileSDKVersion (samples-emdkforandroid-6_4/build.gradle at BarcodeSample1 · Zebra/samples-emdkforandroid-6_4 · GitHub ) but there is an example of including the jar file as provided in one of my personal projects: MxLockDown/build.gradle at master · darryncampbell/MxLockDown · GitHub  .  This is the include.gradle section of the NS plugin development guide, make sure you are not using compile.
* Ensure you have the appropriate entries in AndroidManifest.xml (uses-permission, samples-emdkforandroid-6_4/AndroidManifest.xml at BarcodeSample1 · Zebra/samples-emdkforandroid-6_4 · GitHub   and uses-library, samples-emdkforandroid-6_4/AndroidManifest.xml at BarcodeSample1 · Zebra/samples-emdkforandroid-6_4 · GitHub  )

There is nothing in the log file that to me looks like an obvious cause so hopefully either of the above two resolve the issue.

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