Home > front end >  Plugin 'Device' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml
Plugin 'Device' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml

Time:09-17

I'm running an embedded Cordova Web view in an existing Xcode project. The app runs, but fails to load any plugins: A Plugin 'Device' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml. The JS interfaces are present, but they can't connect to the native implementations.

I've tried adding plugins with plugman, and with cordova plugin add. I'm not sure what the difference is, they just seem to copy the plugin files to different directories. In either case, I have to manually add the source files to my project, but the errors persist. I don't understand why the error is talking about config.xml when he official Cordova CLI-generated Xcode project has an unmodified config.xml, without any tags - how is that project able to find its plugins?

CodePudding user response:

I was looking at the wrong config.xml file... Cordova makes a copy of the source config file in the project root, and stores it in the platforms/ios/<Project name> directory when you run cordova prepare. This version has a tag for every plugin added.

I copied this file to my existing Xcode project, and it loaded the plugins successfully.

  • Related