raix-push icon indicating copy to clipboard operation
raix-push copied to clipboard

Cannot find plugin.xml for plugin 'cordova-plugin-compat'

Open derwaldgeist opened this issue 8 years ago • 13 comments

Since a while, I am getting this error when trying to run an app with meteor run android-device:

% "cordova-plugin-file" is required by (cordova-plugin-file-transfer) and cannot be removed (hint: use -f or --force) and cannot be removed (hint: use -f or --force)
% Failed to install 'phonegap-plugin-push':CordovaError: Cannot find plugin.xml for plugin 'cordova-plugin-compat'. Please try adding it again.
  at new PluginInfo (/Users/waldgeist/.meteor/packages/meteor-tool/.1.1.10.195lp5z++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/cordova-lib/src/PluginInfo.js:329:15)
  at PluginInfoProvider.get (/Users/waldgeist/.meteor/packages/meteor-tool/.1.1.10.195lp5z++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/cordova-lib/src/PluginInfoProvider.js:35:32)
  at /Users/waldgeist/.meteor/packages/meteor-tool/.1.1.10.195lp5z++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/cordova-lib/src/plugman/prepare.js:80:45
  at Array.forEach (native)
  at Object.handlePrepare (/Users/waldgeist/.meteor/packages/meteor-tool/.1.1.10.195lp5z++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/cordova-lib/src/plugman/prepare.js:78:24)
  at /Users/waldgeist/.meteor/packages/meteor-tool/.1.1.10.195lp5z++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/cordova-lib/src/plugman/install.js:586:28
  at _fulfilled (/Users/waldgeist/.meteor/packages/meteor-tool/.1.1.10.195lp5z++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/q/q.js:787:54)
  at self.promiseDispatch.done (/Users/waldgeist/.meteor/packages/meteor-tool/.1.1.10.195lp5z++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/q/q.js:816:30)
  at Promise.promise.promiseDispatch (/Users/waldgeist/.meteor/packages/meteor-tool/.1.1.10.195lp5z++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/q/q.js:749:13)
  at /Users/waldgeist/.meteor/packages/meteor-tool/.1.1.10.195lp5z++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/q/q.js:810:14
  at flush (/Users/waldgeist/.meteor/packages/meteor-tool/.1.1.10.195lp5z++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/q/q.js:108:17)
  at process._tickCallback (node.js:448:13)

=> Errors executing Cordova commands:                                              

   While adding plugin [email protected] to Cordova project:              
   Cordova error: Cannot find plugin.xml for plugin 'cordova-plugin-compat'. Please try adding it
   again.
   (If the error message contains suggestions for a fix, note that this may not apply to the Meteor
   integration. You can try running again with the --verbose option to help diagnose the issue.)

It works if I do a meteor reset right before the meteor run, but it won't work for a second meteor run. Any ideas what might be causing this? Is there any update in the push plugin that's not compatible any more? Note: I'm still on Meteor 1.2.

derwaldgeist avatar May 05 '16 08:05 derwaldgeist

Additional info: I now ran meteor with the --verbose command. This shows that this happens when Meteor is uninstalling the phonegap-plugin-push plugin:

Preparing Cordova project from app bundle     
Processing mobile-config.js                   
Copying resources for mobile apps             
Writing new config.xml                        
Removing plugins                              
com.concats.cordova-plist-patches,com.meteor.cordova-update,cordova-plugin-console,cordova-plugin-device,cordova-plugin-file,cordova-plugin-file-transfer,cordova-plugin-globalization,cordova-plugin-legacy-whitelist,cordova-plugin-splashscreen,cordova-plugin-statusbar,cordova-plugin-insomnia,cordova-plugin-camera,phonegap-plugin-push
from Cordova project
% Plugin "cordova-plugin-insomnia" is not present in the project. Converting value to "nl.x-services.plugins.insomnia" and trying again.
% Plugin "cordova-plugin-camera" is not present in the project. Converting value to "org.apache.cordova.camera" and trying again.
% Uninstalling cordova-plugin-statusbar from android
% Uninstalling cordova-plugin-legacy-whitelist from android
% Uninstalling cordova-plugin-globalization from android
% Uninstalling cordova-plugin-file-transfer from android
% Uninstalling cordova-plugin-file from android
% Uninstalling cordova-plugin-device from android
% Uninstalling cordova-plugin-console from android
% Uninstalling com.meteor.cordova-update from android
% Uninstalling com.concats.cordova-plist-patches from android
% Uninstalling nl.x-services.plugins.insomnia from android
% Uninstalling cordova-plugin-splashscreen from android
% Uninstalling phonegap-plugin-push from android
=> Errors executing Cordova commands:         

   While removing plugins                     
   com.concats.cordova-plist-patches,com.meteor.cordova-update,cordova-plugin-console,cordova-plugin-device,cordova-plugin-file,cordova-plugin-file-transfer,cordova-plugin-globalization,cordova-plugin-legacy-whitelist,cordova-plugin-splashscreen,cordova-plugin-statusbar,cordova-plugin-insomnia,cordova-plugin-camera,phonegap-plugin-push
   from Cordova project:
   Cordova error: CordovaError: Cannot find plugin.xml for plugin 'cordova-plugin-compat'. Please try adding it again.
   at new PluginInfo
   (/Users/waldgeist/.meteor/packages/meteor-tool/.1.1.10.195lp5z++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/cordova-lib/src/PluginInfo.js:329:15)
   at PluginInfoProvider.get
   (/Users/waldgeist/.meteor/packages/meteor-tool/.1.1.10.195lp5z++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/cordova-lib/src/PluginInfoProvider.js:35:32)
   at
   /Users/waldgeist/.meteor/packages/meteor-tool/.1.1.10.195lp5z++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/cordova-lib/src/plugman/prepare.js:80:45
   at Array.forEach (native)
   at Object.handlePrepare
   (/Users/waldgeist/.meteor/packages/meteor-tool/.1.1.10.195lp5z++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/cordova-lib/src/plugman/prepare.js:78:24)
   at
   /Users/waldgeist/.meteor/packages/meteor-tool/.1.1.10.195lp5z++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/cordova-lib/src/plugman/uninstall.js:341:28
   at _fulfilled
   (/Users/waldgeist/.meteor/packages/meteor-tool/.1.1.10.195lp5z++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/q/q.js:787:54)
   at self.promiseDispatch.done
   (/Users/waldgeist/.meteor/packages/meteor-tool/.1.1.10.195lp5z++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/q/q.js:816:30)
   at Promise.promise.promiseDispatch
   (/Users/waldgeist/.meteor/packages/meteor-tool/.1.1.10.195lp5z++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/q/q.js:749:13)
   at
   /Users/waldgeist/.meteor/packages/meteor-tool/.1.1.10.195lp5z++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/q/q.js:810:14
   at flush
   (/Users/waldgeist/.meteor/packages/meteor-tool/.1.1.10.195lp5z++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/q/q.js:108:17)
   at process._tickCallback (node.js:448:13)

   (If the error message contains suggestions for a fix, note that this may not apply to the Meteor integration. You can try running again with the --verbose
   option to help diagnose the issue.)

ExitWithCode:1

derwaldgeist avatar May 05 '16 09:05 derwaldgeist

hmm - not sure you can try 3.0.3-rc.3 this is using the latest cordova plugin

raix avatar May 05 '16 13:05 raix

Thanks, will try this. However, I already got the feedback from the author of the Cordova plugin that it isn't using cordova-plugin-compat at all. Any idea what might cause this? I saw another person on the Meteor forums who is facing the same issue. My research revealed that cordova-plugin-compat was introduced just recently to bridge older Cordova versions to the newer Android rights management. But I have no idea why this should break my former working Meteor app.

derwaldgeist avatar May 06 '16 21:05 derwaldgeist

@derwaldgeist I haven't seen this issue

Debug idea try:

  • go into .meteor/local/cordovaBuild
  • cordova plugin list
  • remove one plugin
  • try cordova build

Repeat the two last steps to find the plugin causing the issue

raix avatar May 11 '16 08:05 raix

OK, good idea, will try this. What command do I have to enter to run the cordova build? I guess it's not the normal Meteor command as this would recreate the build folder?

derwaldgeist avatar May 11 '16 09:05 derwaldgeist

use the cordova cli tool in the cordova build folder $ cordova build

raix avatar May 11 '16 09:05 raix

I tried this. Interestingly, the cordova build command prints this output even if I remove all plugins:

 Using this version of Cordova with older version of cordova-android is being deprecated. Consider upgrading to [email protected] or newer.
 Using this version of Cordova with older version of cordova-ios is being deprecated. Consider upgrading to [email protected] or newer.
Error: Cannot find plugin.xml for plugin 'cordova-plugin-compat'. Please try adding it again.

And I can see in the android.json and ios.json file the following line:

"dependent_plugins": {
        "cordova-plugin-compat": {
            "PACKAGE_NAME": "io.guzz.mobileapp"
        },
        "cordova-plugin-file": {
            "PACKAGE_NAME": "io.guzz.mobileapp"
        }
    }

If I remove the json files too, the error message disappears.

Maybe this is an incompatibility of the latest Cordova CLI version with Meteor 1.2?

derwaldgeist avatar May 11 '16 10:05 derwaldgeist

I think I could track this down a bit more. Cordova CLI seems to install this cordova-plugin-compat plugin automatically. This works if the Meteor build is run for the first time. But if you do a second run, Meteor removes all plugins due to some reason. And during this removal process, the error is thrown as this plugin seems to be required during the removal process. The error shows up as soon as Meteor has removed the plugin folder of the cordova-plugin-compat plugin.

derwaldgeist avatar May 11 '16 10:05 derwaldgeist

I'm closing this here as it does not seem to be related to raix:push. But thanks for routing me to the right place to track it down. Will open an issue in the main Meteor repo now.

derwaldgeist avatar May 11 '16 10:05 derwaldgeist

if thats the case just add the compat plugin in the .meteor/corova-plugins

raix avatar May 11 '16 10:05 raix

This worked, thanks! Funny enough, I tried this before and it didn't. Maybe I did not delete the corrupted cordova-build folder before. Anyways, I've also filed an issue in the Meteor repo now: https://github.com/meteor/meteor/issues/7029

derwaldgeist avatar May 11 '16 10:05 derwaldgeist

The workaround only works until you change your plugins configuration. In this case, Meteor will uninstall and re-install all plugins and the error occurs again. I guess it was the missing cordova-plugins-compat plugin why this re-install was triggered every time I was running meteor run xxx-device.

derwaldgeist avatar May 11 '16 10:05 derwaldgeist

I SOLVED that by add the plugin from GitHub repository: https://github.com/meteor/meteor/issues/8998#issuecomment-353261759

renjithspace avatar Dec 21 '17 05:12 renjithspace