11

I am using the Cordova Splash Screen plugin (http://plugins.cordova.io/#/package/org.apache.cordova.splashscreen) and there is a bug with the current plugin that is causing the app to constantly crash. It appears the bug is documented here (https://issues.apache.org/jira/browse/CB-7497) but has not yet been fixed in an update, although a workaround is provided.

How do I incorporate the workaround in my project as I am unfamiliar with how to create or modify Cordova plugins. I edited the code to include the workaround mentioned, but how do I get the plugin to recompile for the actual Cordova or iOS project with the changes to the code that were made? I am a beginning to this, so if someone can provide easy to understand instructions on how I would go about incorporate this modified plugin back into my project I would appreciate it.

user3324565
  • 111
  • 1
  • 1
  • 3

3 Answers3

13

If you want to change a downloaded plugin locally, you have to modify the plugin source files that are already copied in the corresponding platform folder, in your case ios folder.

For example the path of a source file of the barcode scanner plugin on Android platform looks like this:

<appname>\platforms\android\src\com\phonegap\plugins\barcodescanner\BarcodeScanner.java

On the other hand, the web portion of the plugin is copied from the plugin installation folder every time you run build command, so you need to change it there. Example:

<appname>\plugins\phonegap-plugin-barcodescanner\www\barcodescanner.js
Michal Liďák
  • 131
  • 1
  • 5
4

First you need to remove old plugin using CLI

cordova plugin remove org.apache.cordova.splashscreen

Then add another ver of plugin

cordova plugin add org.apache.cordova.splashscreen**

after installation build your project and run.

Ved
  • 2,701
  • 2
  • 22
  • 30
  • 6
    This works but is slightly painful - seems like there should be a way to re-deploy the plugin for test purposes? – McGarnagle Jan 31 '15 at 21:48
2

If you are debugging or want to modify the plugin code for any reason (including the plugin.xml file), you should remove and add the platform again. All the plugin code will be deployed to the corresponding platform according to the xml file:

cordova platform remove ios
cordova platform add ios
Kilian Perdomo Curbelo
  • 1,281
  • 1
  • 15
  • 31