4 Replies Latest reply on Apr 26, 2017 7:15 AM by Nate Smith

    Starting out with EMDK

    Nate Smith

      So we're starting work on coding for an MC40, and running into an error when trying to integrate EMDK into our code.  Everything works fine until I try and load the activity that initializes EMDK, and then I get the following error:

       

      04-24 17:46:05.995 8578-8578/<appid> I/art: Rejecting re-init on previously-failed class java.lang.Class<<appid>.ChangeLocationActivity>

      04-24 17:46:05.996 8578-8578/<appid> I/art: Rejecting re-init on previously-failed class java.lang.Class<<appid>.ChangeLocationActivity>

      04-24 17:46:06.949 8578-8578/<appid> I/art: Rejecting re-init on previously-failed class java.lang.Class<<appid>.ChangeLocationActivity>

      04-24 17:46:06.950 8578-8578/<appid> D/AndroidRuntime: Shutting down VM

      04-24 17:46:06.955 8578-8578/<appid> E/AndroidRuntime: FATAL EXCEPTION: main

                                                                                                Process: <appid>, PID: 8578

                                                                                                java.lang.NoClassDefFoundError: <appid>.ChangeLocationActivity

                                                                                                    at <appid>.ActionSelect$1.onClick(ActionSelect.java:41)

                                                                                                    at android.view.View.performClick(View.java:4780)

                                                                                                    at android.view.View$PerformClick.run(View.java:19866)

                                                                                                    at android.os.Handler.handleCallback(Handler.java:739)

                                                                                                    at android.os.Handler.dispatchMessage(Handler.java:95)

                                                                                                    at android.os.Looper.loop(Looper.java:135)

                                                                                                    at android.app.ActivityThread.main(ActivityThread.java:5254)

                                                                                                    at java.lang.reflect.Method.invoke(Native Method)

                                                                                                    at java.lang.reflect.Method.invoke(Method.java:372)

                                                                                                    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)

                                                                                                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

       

      Other reading I've done online suggests that this is an issue with EMDK loading properly, but I'm not sure what direction to head to resolve it.  Can anyone help?

       

      EDIT: So I did a little more digging, and I noticed that the EMDK page only says compatibility with the MC40 when running KitKat, and I have Lollipop on this device.  Do I need to downgrade it?

        • Re: Starting out with EMDK
          Darryn Campbell

          Hi Nate, I'm surprised but yes, according to the device compatibility in the release notes, EMDK for Android v6.3 Release Notes Support | Zebra , the latest version of EMDK does not yet support MC40 Lollipop though I imagine support will be present in an upcoming release.

           

          Have you tried running an application which is known to work, e.g. Basic Scanning Tutorial using Barcode API - Zebra Technologies Techdocs  or Barcode APIs - Zebra Technologies Techdocs ?  If either of those give the same error you know it is an incompatibility with MC40 Lollipop.  I haven't seen those errors before in relation to EMDK I am afraid.

            • Re: Starting out with EMDK
              Nate Smith

              I tried compiling and running the Barcode API sample, but based on Peter's post below, it sounds like I didn't have the API levels and build tools version set quite right(I'm as new to Android development as I am to EMDK), as I was having trouble even getting it to compile.  As mentioned below, I changed the code to use DataWedge via Intents for now, so I'll keep this information in case I have to revisit using EMDK in the future.

            • Re: Starting out with EMDK
              Peter Arcuri

              Hi Nate, I wanted to let you know that I successfully ran the Barcode API sample app on a MC40 with Lollipop. I simply changed the API level from 19 to "Google APIs, Android 22" with Build Tools version 25.0.0. BTW, I'm using Android Studio v2.3. Also added dependencies in the build.gradle from within the app section. Looks like below:

               

              dependencies {

                provided fileTree(include: ['com.symbol.emdk.jar'], dir: '/Users/yourUser/Android/android-sdk-macosx/add-ons/addon-symbol_emdk-symbol-22/libs')

                compile fileTree(exclude: ['com.symbol.emdk.jar'], dir: 'libs')

              }

               

              In addition, be aware that if you're using any recent EMDK 6.3 features you will need to update the EMDK service on the MC40. The default version of EMDK service on the MC40 L is v5.0.3. You will find the EMDKOSUpdateApp_v6.3.23.apk from the "Device Update" folder within the EMDK-A-060307 install.