Mobile | Plugin Cordova || Scanbar | index 1 beyond bound


Good afternoon,

I had to change the layout of the csZBar plugin, the plugin in the scanbar. And this change also implied the passage of one more input parameter, which will be an image. On the Android side, I managed to do everything without problems ... on the side of iOS, without touching anything on the side of Swift, I'm giving this error (iamge bellow) after having generated new build and have installed the new IPA.

Can anyone help me?

It seems to me that it is something connected to Cordova... it seems to me that he has this error whenever he tries to get things from Cordova, but I can not be sure about this my opinion.

On the device side of the log, I also don't throw much information ...

Unable to find resource: /AABBCC/scripts/cordova_plugins.js



Regards,
Nuno Miguel Verdasca



To clarify, are you using a plugin from the Forge and customizing it, or are you wrapping an existing Cordova plugin for OutSystems and modifying the UI?

I had to change the layout of the csZBar plugin, the plugin in Scanbar. I've cloned the plugin GitHub (https://github.com/OutSystems/csZBar/tree/master/android), and I'm making layout changes from my side. These layout changes imply the passing of one more input parameter, which will be a dynamic image (binary), which is converted to Base64 text, since the parameters are sent by Json.


On the Android side, I was able to do everything without problems, and it's working perfectly. On the iOS side, without touching Swift, is giving this error (image below) after having generated a new build and have installed the new IPA, and when I go to start the App, it simply closes. When I debug, I see that it bursts when on the side of the Outsystems Platform, if it leaves the call to the plugin, the success message comes to false. The screen does not even open the scanner.


I'm using a forge plugin (https://www.outsystems.com/forge/component-overview/1403/barcode-plugin)


Two suggestions:

  1. Before attempting to completely customize the plugin, you might post a new discussion to the discussion area for the plugin: https://www.outsystems.com/forge/component-discussions/1403/Barcode+Plugin, with what you want to achieve. There may be an easier way than what you're currently trying. You could also try contacting support, via the link on the plugin Support page.
  2. If you clone the Cordova plugin on Github and modify it from there, you're no longer using the Forge component at that point, so the component would no longer be supported.

I'm not an iOS native dev expert, so I can't tell you whether what you want to accomplish is possible without modifying the Swift code. You may need to get iOS-specific expertise to complete the customization, which may not be OutSystems-specific at all.

Keep in mind that just because you are getting an error on the OutSystems side that doesn't necessarily mean that the issue is originating there. The stack trace you posted pretty clearly indicates an exception that's taking place on the native side in iOS, and the issue seems to be an index out of bounds error, which would require looking at the native code to understand why that's happening.

G. Andrew Duthie wrote:

Two suggestions:

  1. Before attempting to completely customize the plugin, you might post a new discussion to the discussion area for the plugin: https://www.outsystems.com/forge/component-discussions/1403/Barcode+Plugin, with what you want to achieve. There may be an easier way than what you're currently trying. You could also try contacting support, via the link on the plugin Support page.
  2. If you clone the Cordova plugin on Github and modify it from there, you're no longer using the Forge component at that point, so the component would no longer be supported.

I'm not an iOS native dev expert, so I can't tell you whether what you want to accomplish is possible without modifying the Swift code. You may need to get iOS-specific expertise to complete the customization, which may not be OutSystems-specific at all.

Keep in mind that just because you are getting an error on the OutSystems side that doesn't necessarily mean that the issue is originating there. The stack trace you posted pretty clearly indicates an exception that's taking place on the native side in iOS, and the issue seems to be an index out of bounds error, which would require looking at the native code to understand why that's happening.

Many thanks for your suggestions Mr. Duthie.

I opened a support case, which is being analyzed at this time.

However it may be that some colleague here in the community has already had this problem and can make a suggestion.


Best regards,

Nuno Miguel Verdasca