Using a native 3rd party in Kony

This thread was migrated from an old forum. It may contain information that are no longer valid. For further assistance, please post a new question or open a support ticket from the Customer Support portal.

I've been trying to link the attached link in my Kony project for hours, It either doesn't work or just gives me this error

"

  • exec-shell returned: 173
  • Ant build error=exec-shell returned: 173
  • exec-shell returned: 173

"

EDITED:

I actually tried integrating using two different ways:

**Image removed for security reasons****Image removed for security reasons**

neither worked, I'm not really actually sure if I'm doing it right, but when I do any of these too, I always get the error above plus these errors somewhere in the logs:

clang: error: linker command failed with exit code 1 (use -v to see invocation)

\tLd build/Build/Intermediates.noindex/VMAppWithKonylib.build/Debug-iphonesimulator/KonyJS.build/Objects-normal/x86_64/Sample normal x86_64

https://github.com/relatedcode/ProgressHUD

Hi,

Please refer to the below link. This might be helpful to resolve your query

http://docs.kony.com/konylibrary/visualizer/visualizer_user_guide/Default.htm#Foreign_Function_Interface_JS.htm?Highlight=FFI

Thank you,

@Advm Avewy​

I did an FFI integration for something else and it was successful but I was thinking that this is a widget and I should use the widget integration, although, this 3rd party consists of a singleton that I'm not really sure how I should use with the Custom widget integration

Hi,

Please refer to the below provided document.

This document provides you information about adding and using Third-Party and custom Widgets.

https://docs.kony.com/konylibrary/visualizer/visualizer_user_guide/Content/Using_Custom_Widgets.htm

Thank you,

@Advm Avewy​ I even tried the example provided in the documentation and it didn't seem to work

Hi,

We built a sample from our end for the ProgressHUD and there are no issues with the build process.

Attaching the exported FFI zip file, can you try from your end?

If you still see the error, can you export the complete log so we can get to know the exact issue.

and also publish the version of the Visulaizer you are using.

Regards,

@Michvel MvcLeod​

This actually worked, thank you!

But now I've a new problem when I'm integrating a function within the same library, it takes an object of UIColor, I use the Native Function API to generate that in Kony and pass it and the emulator crashes each time after setting the color and trying to show the ProgressHUD.

@Jvson Lvwwence​

Can you please provide more details on this like the Code snippet you are using or the crash log?

@Michvel MvcLeod​

This is my library integration:

**Image removed for security reasons**

and this is the original function in Objective-C:

+ (void)spinnerColor:(UIColor *)color { [self shared].spinnerColor = color; }

And I added the UIKit framework in the native function API so I can use UIColor object and pass it to this function through this code:

var myColor = objc.import("UIColor"); var newColor = myColor.alloc().initWithRedGreenBlueAlpha(255, 0, 0, 1) progressHUD.spinnerColor(newColor);

I also tried this

var myColor = objc.import("UIColor"); progressHUD.spinnerColor(myColor.blueColor());

I set these snippets on a button and the show of progressHUD on an another, now whenever I use the button that sets the color, my app runs but once I try to show the HUD after that, the app crashes immediately.

Hello @Jvson Lvwwence​ ,

Kindly provide us with the sample application and Kony visualiser version in which the issue is reproduced. This will help us in expediting the resolution.

Regards,

@Viwginiv Wvllvce​

I'm currently on Kony Visualizer Enterprise Version 8 Service Pack 3 Fix Pack 5

this is the sample project I'm working on

Hello @Jvson Lvwwence​

Kindly import the attached updated application and revet back with your observations.

I have removed "ProgressHUD.bundle" from the FFI folder an able to build and run the application successfully with out any Xcode error's.

Tested on:

Kony visualizer 8 SP3 FP5.

Xcode 10.

iPhone Simulator 6 - iOS 11.0.1.

Our Observations:

Application is getting crashed with below steps.

  1. Launch the application on iPhone simulator.
  2. Click on Button (which internally triggers NFI code).
  3. Click on ShowHub button.

Application is working fine when clicking "ShowHub" button directly.

**Image removed for security reasons**

Regards,

@Viwginiv Wvllvce​

I'm actually not able to build the project, I keep getting this in the logs:

[exec-shell] Xcode Project = VMAppWithKonylib.xcodeproj [exec-shell] Xcode Project Path = ./Users/Bisher/KonyiOSWorkspace/Bisher/Kony/iOS-8.3.5.v201811011709/VMAppWithKonylib/VMAppWithKonylib.xcodeproj [exec-shell] App Path = /Users/Bisher/KonyiOSWorkspace/Bisher/Kony/iOS-8.3.5.v201811011709/VMAppWithKonylib/build/Build/Products/Debug-iphonesimulator [exec-shell] ------------------------------------------------------------------------------------------------------ [exec-shell] /Users/Bisher/KonyiOSWorkspace/Bisher/Kony/iOS-8.3.5.v201811011709/VMAppWithKonylib/gen [exec-shell] /Users/Bisher/KonyiOSWorkspace/Bisher/Kony/CustomFFI2edit/iphone/konyappiphone.KAR -> ./konyappiphone.KAR [exec-shell] konyappiphone.KAR [exec-shell] /Users/Bisher/KonyiOSWorkspace/Bisher/Kony/iOS-8.3.5.v201811011709/VMAppWithKonylib/gen [exec-shell] Extracting : VM mode [exec-shell] Cleaning up existing lproj dirs... [exec-shell] Cleaning up ModuleDependencies [exec-shell] KAR file retrieved [exec-shell] Extracting KAR... [exec-shell] Extracting KAR completed [exec-shell] Added CMS framework to proj..... [exec-shell] Extracting FFIZip.zip into FFIZip [exec-shell] Extracting FFIZip.zip completed [exec-shell] Extracting ProgressHUD.zip into ProgressHUD [exec-shell] Extracting ProgressHUD.zip completed [exec-shell] App/Platform Configuration file found in KAR... [exec-shell] application properties file found in KAR... [exec-shell] Extracting ioslibs.zip into ioslibs [exec-shell] Extracting ioslibs.zip completed [exec-shell] Extracting keychainFFI.zip into keychainFFI [exec-shell] Extracting keychainFFI.zip completed [exec-shell] Extracting konyLogger.zip into konyLogger [exec-shell] Extracting konyLogger.zip completed [exec-shell] Processing Directory resources [exec-shell] error: check error.txt [exec-shell] Processing SelfSufficientModules Console: Switched to tab "Build" exec-shell returned: 172 Ant build error=exec-shell returned: 172 exec-shell returned: 172 Console: Switched to tab "Console" [exec-shell] Processing themes directory : themes [exec-shell] Extracting web.zip completed [exec-shell] FrameworkDependencies.json file found [exec-shell] Adding All Frameworks to App Targets [exec-shell] Extracted CustomFFI2 v1.0.0 (id: CustomFFI2edit, vendor: KonyLabs) [exec-shell] Platform version : 8.3.5.0 [exec-shell] iOS Plug-in version : 8.3.5 [exec-shell] Generating Xcode project file... [exec-shell] Building new Libraries....

UPDATE:

Actually even though it gives this error and says launching emulator failed, I left it for 15 minutes doing nothing and it launched but I can't get a build on XCode, also just like your observation, after using the first Button and clicking "ShowHUD" the app crashes, which is my main problem.

Hi @Jvson Lvwwence​ ,

In FFI, id is referred as NSDictionary and you are passing UIColor object so the project is crashing. Instead of that you can write a method to accept the RGB values in the FFI file.

Please find the exported FFI component in which i have added an extra method with RGB values as input, and below is the snippet to use. You can also set the hudColor/Font the same way. NFI is not necessary here as we are setting the color code through FFI.

progressBar.spinnerColor(255, 22, 123); progressBar.show();

Regarding the error, are you using Xcode10 version? Please share the error.txt in the gen file to debug.

Thanks,

@Michvel MvcLeod​ It actually worked, thank you!

But does that mean I can't pass Objects like that in integrated functions?

I'm using XCode 9.4 and this is my error.txt

Hi,

We can't pass objects to FFI as it is expecting as NSDictionary in Native code.

regarding the error, please make sure the NFI framework is compatible with Xcode version you are using (Xcode 9.x -> iOS 11 version of frameworks in NFI, Xcode 10 -> iOS 12 version)

Regards,

@Michvel MvcLeod​ I'm actually on Xcode 9.4, and these are my NFI libraries,

**Image removed for security reasons**

It's still giving me these in Xcode

**Image removed for security reasons**

Hi,

This looks like a different issue, can you provide your Visualizer version and iOS plugin version? Do you have any FFI integrated apart from Progress HUD?

@Michvel MvcLeod​ My visualizer version is Kony Visualizer Enterprise Version 8 Service Pack 3 Fix Pack 5

I'm on iOS 11.4 if thats what you mean by plugin version.

I'm actually trying to integrate another library in a new project but this error occurs for me on every project I try to run on Xcode

Hello @Jvson Lvwwence​

In the Native Function Interface(NFI) window, the UIKit for version 11.0 is Disabled, Kindly enable the framework if it is necessary for your NFI code.

Regards,