An Karthik An Karthik - 27 days ago 15
Android Question

Updating salesforce Hybrid cordova app

I am a little new to Salesforce Hybrid Mobile application development.

I have a well running hybrid application.

But recently when uploading the APK to play store, play store gives an error

Your APK has been rejected for containing security vulnerabilities, which violates the Malicious Behavior policy. The Alerts page has more information about how to resolve the issue. If you submitted an update, the previous version of your app is still live on Google Play.


After some analysis I found that my android platform version is
3.6.x
which might be the reason for rejection.

So I updated cordova android platform of my existing Salesforce Hybrid app using the following command.

cordova platform update android


After updating the version of android platform is
5.2.2


Salesforce Mobile sdk guide says to reinstall the salesforce plugin

So,

cordova plugin remove com.salesforce


And then

cordova plugin add https://github.com/forcedotcom/SalesforceMobileSDK-CordovaPlugin


But, while re-adding the plugin it gives the following message

Plugin doesn't support this project's cordova-android version. cordova-android: 5.2.2, failed version requirement: 5.0.0
Skipping 'com.salesforce' for android


And again running the project in eclipse gives many errors.

Not able to pin point the specefic issue here.

Any help is appretiated.

Thanks in advance.

Answer

You have to update to 5.0.0 instead of 5.2.2 because Salesforce plugin is made to 5.0.0 version.

You can see that in the plugin.xml file, in the engine tag.

<engines> <engine name="cordova-android" version="5.0.0" /> <engine name="cordova-ios" version="4.2.0" /> </engines>