+ Start a Discussion

Handling cordova in the server side for iOS



The below part of code in SFSmartStorePlugin is not executing in iOS salesforce SDK.

SDK Version: 1.4



exec(SDK_VERSION, successCB, errorCB, SERVICE,
             [{"soupName": soupName, "querySpec": querySpec}]
Best Answer chosen by Admin (Salesforce Developers) 
Kevin HawkinsKevin Hawkins

Ah, it looks like the submodules may not be synced.  Run install.sh from the root of the repository, and try the build again.  Hopefully that will fix it up.


All Answers


To add to the above issue,we are facing issue in executing the smart store query in IOS.

Our application saves data from salesforce for offline storage in a smartstore.

We have included all the smartstore and cordova plugins in the server side.

We used SalesforceMobilesdk for both android and IOS .

In Ios alone,we are facing issues in quering the data from smartstore .

Also if you click on Home button in iPhone,query soups gets executed and returned the results in alert but we are unable to display them in a picklist.

Gaurav KheterpalGaurav Kheterpal

I haven't really understood your question very well but one suggestion - please do upgrade to iOS SDK 2.0 as it has several fixes and enhancements especially related to SmartStore.


If you still face issues with iOS SDK 2.0, please provide a clear description of the problem and the relevant code snippet.


Hi gauravkheterpal ,


Thanks for the reply.

we are using SDK 2.0 version currently.

To describe more on the Problem.We have 2 visualforce pages.We are registering soups to smartstore in a page and then tries to query them in other page.Smartstore gets created successfully and while retrieving we are unable to exec smartstore query but if we click on Homebutton on IOS Simulator,exec query gets called and prints data in logs.


Please help us in this regard.

Gaurav KheterpalGaurav Kheterpal

Can you post your code snippet of how you are retrieving data from the Smartstore?



Below are the code snippets for registering soup and querying the smartstore.


Registering Soup is done as below


//Registering soup for storing Skills
        var indexesSkills = [



Execute query is  as below


var soupExists = function (soupName, successCB, errorCB) {
        console.log("SmartStore.soupExists: " + soupName);
        exec(SDK_VERSION, successCB, errorCB, SERVICE,
             [{"soupName": soupName}]
Kevin HawkinsKevin Hawkins

This looks like a bug with the version of Cordova that's shipped with the Mobile SDK.  We'll take a look and see what's going on.


Hi Kevin,


Version of Cordova which we are using currently is 2.3.0 which comes with Mobile SDK.

Please help us in this regard.



Kevin HawkinsKevin Hawkins

Yes, I can reproduce the issue with the stock SDK.  I'll see if I can track down the culprit, and I'll post back here when I have more information.  Thanks for bringing it to our attention.

Kevin HawkinsKevin Hawkins

This has been fixed on the master branch of the Mobile SDK.  To grab the fix, you can do the following:


  1. Sync the git repository to the latest version on master.
  2. cd build
  3. ant buildSalesforceHybridSDK
  4. Grab SalesforceHybridSDK-Debug.zip or SalesforceHybridSDK-Release.zip from the artifacts/ folder, unzip it, and replace the contents of the SalesforceHybridSDK folder in your app with the new library artifacts.  Technically, you can just replace libSalesforceHybridSDK.a; the other files will not have changed.

Hello Kevin,

Thank you for the update.

We tried following the steps give. But in the 3rd step BUILD failed due to the below error.  Please let us know how to solve this.


[exec] ** BUILD FAILED **
[exec] The following build commands failed:
[exec] ProcessPCH /Users/HWAero/Library/Developer/Xcode/DerivedData/SalesforceMobileSDK-eqpdjevwuuhyuogagkmozdpyiurx/Build/Intermediates/PrecompiledHeaders/SalesforceHybridSDK-Prefix-bdsarxajpdonioclipdjdtfkcvxd/SalesforceHybridSDK-Prefix.pch.pth SalesforceHybridSDK/SalesforceHybridSDK-Prefix.pch normal armv7s objective-c com.apple.compilers.llvm.clang.1_0.compiler
[exec] ProcessPCH /Users/HWAero/Library/Developer/Xcode/DerivedData/SalesforceMobileSDK-eqpdjevwuuhyuogagkmozdpyiurx/Build/Intermediates/PrecompiledHeaders/SalesforceHybridSDK-Prefix-fnwywizwxyvmlidjnukypfnllddo/SalesforceHybridSDK-Prefix.pch.pth SalesforceHybridSDK/SalesforceHybridSDK-Prefix.pch normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
[exec] (2 failures)
[exec] /Users/HWAero/Documents/SalesforceMobileSDK-iOS/hybrid/SalesforceHybridSDK/SalesforceHybridSDK/SalesforceHybridSDK-Prefix.pch:7:13: fatal error: 'SFLogger.h' file not found
[exec] #import "SFLogger.h"
[exec] ^
[exec] 1 error generated.

Kevin HawkinsKevin Hawkins

Ah, it looks like the submodules may not be synced.  Run install.sh from the root of the repository, and try the build again.  Hopefully that will fix it up.


This was selected as the best answer
jeniffer homesjeniffer homes
Run install.sh from the root of the repository, and try the build again.  Hopefully that will fix it up.
Jeniffer (http://www.greatbasinindustrial.com)