0 Replies Latest reply on Feb 4, 2017 10:35 AM by Darren West

    java.lang.ArrayIndexOutOfBoundsException: EMDKResults.

      I might be missing an important step, but I have no idea what it is.

      Firstly, The applications runs fine if I select it from the desktop, or thru androiid Studio.  (scanning works good) .

      If I reset the device, the launcher will appear and I'll select the app with the "Always" option.

      The application will run  for about 5 seconds, then crash with no user intervention.

       

      Thanks in advance.

       

      Unit: MC92N0

      Also use the Profile Manager built in tool in Android Studio.

       

      -Darren

       

      java.lang.ArrayIndexOutOfBoundsException: length=18; index=19

      W/System.err(  803):     at com.symbol.emdk.EMDKResults.getExtStatusCodeFromXMLString(EMDKResults.java:516)

      W/System.err(  803):     at com.symbol.emdk.EMDKResults.<init>(EMDKResults.java:330)

      W/System.err(  803):     at com.symbol.emdk.ProfileManager.processProfile(ProfileManager.java:296)

      W/System.err(  803):     at com.symbol.emdk.ProfileManager.processProfile(ProfileManager.java:429)

      W/System.err(  803):     at ********************************************************MY APPLICATION******.onOpened(MainActivity.java:471)

      W/System.err(  803):     at com.symbol.emdk.EMDKServiceConnection.notifyonConnected(EMDKServiceConnection.java:112)

      W/System.err(  803):     at com.symbol.emdk.EMDKServiceConnection.onServiceConnected(EMDKServiceConnection.java:92)

      W/System.err(  803):     at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1101)

      W/System.err(  803):     at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1118)

      W/System.err(  803):     at android.os.Handler.handleCallback(Handler.java:733)

      W/System.err(  803):     at android.os.Handler.dispatchMessage(Handler.java:95)

      W/System.err(  803):     at android.os.Looper.loop(Looper.java:136)

      W/System.err(  803):     at android.app.ActivityThread.main(ActivityThread.java:5002)

      W/System.err(  803):     at java.lang.reflect.Method.invokeNative(Native Method)

      W/System.err(  803):     at java.lang.reflect.Method.invoke(Method.java:515)

      W/System.err(  803):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)

      W/System.err(  803):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)

      W/System.err(  803):     at dalvik.system.NativeStart.main(Native Method)

       

       

      @Override

          public void onOpened(EMDKManager emdkManager) {

              this.emdkManager = emdkManager;

              myScanner = new MyScanner(emdkManager);

           

              myScanner.deInitScanner();

              ProfileConfig profileConfigObj = new ProfileConfig();

              //Get the Profile Manager

              ProfileManager profileManager = (ProfileManager)emdkManager.getInstance(EMDKManager.FEATURE_TYPE.PROFILE);

              //Create the new profile

              EMDKResults results = profileManager.processProfile("myEmdkProfile", ProfileManager.PROFILE_FLAG.SET, profileConfigObj);

       

          }

       

       

       

      //gradle

       

      dependencies {

        

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

          androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {

              exclude group: 'com.android.support', module: 'support-annotations'

          })

          provided fileTree(include: ['com.symbol.emdk.jar'], dir: 'libs')

          compile 'com.android.support:appcompat-v7:23.0.1'

          compile 'com.android.support:design:23.0.1'

          testCompile 'junit:junit:4.12'

       

       

      //manifest

       

      <uses-permission android:name="com.symbol.emdk.permission.EMDK"/>

          <uses-permission android:name="android.permission.INTERNET" />

          <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>

          <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

          <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>

          <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />

          <uses-permission android:name="android.permission.BLUETOOTH" />

          <uses-permission android:name="android.permission.READ_LOGS" />

          <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

          <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

          <uses-permission android:name="android.permission.REORDER_TASKS" />

       

          <application

           

       

               <uses-library android:name="com.symbol.emdk"/>