12 Replies Latest reply on Jun 11, 2018 11:33 PM by Darryn Campbell

    App crashing when trying to add the EMDK as a dependency.

    d300b70b-7fcb-41a5-ba53-5694efbf67d2

      I have setup the EMDK for Android Studio as "Importing EMDK lib Jar as a Module" by following the steps at the following url EMDK For Android Setup (Android Studio1.0.x) - Zebra Technologies Techdocs

      Build .gradle contains the following :

       

      compile project(':com.symbol.emdk')

       

      Crash reason :

      Check failed: called != nullptr int java.lang.Enum.ordinal() com.symbol.emdk.EMDKManager$FEATURE_TYPE[]

       

      -----------------

      When the gradle is changed to

       

      provided project(':com.symbol.emdk')

      It is unable to import com.symbol.emdk.barcode.Scanner;

      -------------

      unable to import if the gradle is changed to

      dependencies {
      provided fileTree
      (include: ['com.symbol.emdk.jar'], dir: '/Users/<YOUR USERNAME>/Library/Android/sdk/add-ons/addon-symbol_emdk-symbol-19/libs')
      compile fileTree
      (exclude: ['com.symbol.emdk.jar'], dir: 'libs')

      --------------------

       

      jrq768@

          • Re: App crashing when trying to add the EMDK as a dependency.
            Darryn Campbell

            Hi, those instructions are quite old... I suggest you add EMDK to your gradle build file as described at EMDK for Android Programming Practices - Zebra Technologies TechDocs

              • Re: App crashing when trying to add the EMDK as a dependency.
                d300b70b-7fcb-41a5-ba53-5694efbf67d2

                Hi,

                App is crashing, please find the attached crash log

                 

                 

                E/UncaughtException: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/xxx/Activity/AcActivity;

                        at com.xxx.x.Adapter.CustomAdapter$1.onClick(CustomAdapter.java:341)

                        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)

                     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.xxx.x.Activity.AcActivity" on path: DexPathList[[zip file "/system/framework/com.google.android.maps.jar", zip file "/data/app/com.xxx.x-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]

                        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)

                        at java.lang.ClassLoader.loadClass(ClassLoader.java:511)

                        at java.lang.ClassLoader.loadClass(ClassLoader.java:469)

                        at com.xxx.x.Adapter.CustomAdapter$1.onClick(CustomAdapter.java:341)

                        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)

                     Suppressed: java.lang.NoClassDefFoundError: com.xxx.x.Activity.AcActivity

                        at dalvik.system.DexFile.defineClassNative(Native Method)

                        at dalvik.system.DexFile.defineClass(DexFile.java:226)

                        at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:219)

                        at dalvik.system.DexPathList.findClass(DexPathList.java:321)

                        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:54)

                          ... 13 more

                     Suppressed: java.lang.ClassNotFoundException: com.xxxx.Activity.AcActivity

                        at java.lang.Class.classForName(Native Method)

                        at java.lang.BootClassLoader.findClass(ClassLoader.java:781)

                        at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)

                        at java.lang.ClassLoader.loadClass(ClassLoader.java:504)

                          ... 12 more

                     Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available

                 

                -----

                Build.gradle file

                provided fileTree(include: ['com.symbol.emdk.jar'], dir: 'C:\\Users\\xxx\\AppData\\Local\\Android\\sdk\\add-ons\\addon-symbol_emdk-symbol-26\\libs')

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