Search code examples
cordovacordova-plugins

Cordova is including a plugin that is not installed, how to remove it?


Edit - This appears to be a problem with the Fovea plugin. I did not realize that it includes substantial code from the older plugin, which made me think that the older plugin was still being referenced. I don't know why it's throwing that IllegalArgumentException but it does not appear to be caused by the old plugin being referenced. So, disregard...

I am working on a Phonegap/Cordova app. Previously, I started with Phonegap, and used the "SmartMobileSoftware" inapppurchase plugin from https://github.com/poiuytrez/AndroidInAppBilling. I installed it per the instructions, by cloning it from git and then using

phonegap local plugin add /path/to/src

Later, due to various problems, I decided to start over with Cordova instead of Phonegap, and using a different purchase plugin. I installed the latest cordova with npm, created a new Cordova app in the usual way using a fresh project dir, and installed the Fovea purchase plugin like so:

cordova plugin add cc.fovea.cordova.purchase

I then copied over my code (html/css/js only, no config files or xml or anything) and everything is ostensibly working, the new purchase plugin loads and initializes.

Here's the mysterious part: the new Cordova apps is somehow including the old billing plugin. I noticed this because I see this IllegalArgumentException in logcat when my app exits:

Service not registered: com.smartmobilesoftware.util....

Sure enough, I checked my platforms\android\res\xml\config.xml and it is referencing the old SmartMobileSoftware plugin, and all of the old plugins files are in ant-build/classes. However, I don't know where Cordova is finding any reference to the old plugin. There is no reference to it in my new project directory (except for platforms/android), and there is no mention of it in either of

cordova plugins ls
phonegap plugins ls

Any guesses what's going on here? It seems like Phonegap put a reference to the old plugin somewhere that Cordova paying attention to, but I don't know where. How would Cordova include a plugin that isn't listed in "cordova plugins ls"?


Solution

  • The problem was that both plugins include some of the same libraries, and I was mistaking the new plugin for a remnant of the old one.