Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cordova iOS plugins not found

Tags:

xcode

ios

cordova

I recently upgraded to Cordova 2.9.0 from 2.3.0. After following all the upgrade instructions, I was able to get the app to launch in the simulator. However, in Xcode I see the following errors:

ERROR: Plugin 'Device' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.
-[CDVCommandQueue executePending] [Line 103] FAILED pluginJSON = ["Device1776032119","Device","getDeviceInfo",[]]
ERROR: Plugin 'NetworkStatus' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.
-[CDVCommandQueue executePending] [Line 103] FAILED pluginJSON = ["NetworkStatus1776032120","NetworkStatus","getConnectionInfo",[]]
-[CDVCommandQueue executePending] [Line 103] FAILED pluginJSON = ["INVALID","Logger","logLevel",["LOG","deviceready has not fired after 5 seconds."]]
ERROR: Plugin 'Logger' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.
-[CDVCommandQueue executePending] [Line 103] FAILED pluginJSON = ["INVALID","Logger","logLevel",["LOG","Channel not fired: onCordovaConnectionReady"]]
ERROR: Plugin 'Logger' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.
-[CDVCommandQueue executePending] [Line 103] FAILED pluginJSON = ["INVALID","Logger","logLevel",["LOG","Channel not fired: onCordovaInfoReady"]]

This is my config.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<widget>
    <feature name="Geolocation">
        <param name="ios-package" value="CDVLocation" />
    </feature>
    <feature name="Device">
        <param name="ios-package" value="CDVDevice" />
    </feature>
    <feature name="Accelerometer">
        <param name="ios-package" value="CDVAccelerometer" />
    </feature>
    <feature name="Compass">
        <param name="ios-package" value="CDVLocation" />
    </feature>
    <feature name="Media">
        <param name="ios-package" value="CDVSound" />
    </feature>
    <feature name="Camera">
        <param name="ios-package" value="CDVCamera" />
    </feature>
    <feature name="Contacts">
        <param name="ios-package" value="CDVContacts" />
    </feature>
    <feature name="File">
        <param name="ios-package" value="CDVFile" />
    </feature>
    <feature name="NetworkStatus">
        <param name="ios-package" value="CDVConnection" />
    </feature>
    <feature name="Notification">
        <param name="ios-package" value="CDVNotification" />
    </feature>
    <feature name="FileTransfer">
        <param name="ios-package" value="CDVFileTransfer" />
    </feature>
    <feature name="Capture">
        <param name="ios-package" value="CDVCapture" />
    </feature>
    <feature name="Battery">
        <param name="ios-package" value="CDVBattery" />
    </feature>
    <feature name="SplashScreen">
        <param name="ios-package" value="CDVSplashScreen" />
    </feature>
    <feature name="Echo">
        <param name="ios-package" value="CDVEcho" />
    </feature>
    <feature name="Globalization">
        <param name="ios-package" value="CDVGlobalization" />
    </feature>
    <feature name="InAppBrowser">
        <param name="ios-package" value="CDVInAppBrowser" />
    </feature>
    <feature name="Logger">
        <param name="ios-package" value="CDVLogger" />
    </feature>
    <feature name="LocalStorage">
        <param name="ios-package" value="CDVLocalStorage" />
    </feature>
    <plugins>
    </plugins>
    <preference name="KeyboardDisplayRequiresUserAction" value="true" />
    <preference name="SuppressesIncrementalRendering" value="false" />
    <preference name="UIWebViewBounce" value="true" />
    <preference name="TopActivityIndicator" value="gray" />
    <preference name="EnableLocation" value="false" />
    <preference name="EnableViewportScale" value="false" />
    <preference name="AutoHideSplashScreen" value="true" />
    <preference name="ShowSplashScreenSpinner" value="true" />
    <preference name="MediaPlaybackRequiresUserAction" value="false" />
    <preference name="AllowInlineMediaPlayback" value="false" />
    <preference name="OpenAllWhitelistURLsInWebView" value="false" />
    <preference name="BackupWebStorage" value="cloud" />
    <preference name="fullscreen" value="true" />
    <preference name="webviewbounce" value="true" />
    <access origin="*.googleapis.com"/>
    <access origin="*.gstatic.com"/>
    <access origin="*.s3.amazonaws.com"/>
</widget>
like image 342
bjudson Avatar asked Jun 29 '13 20:06

bjudson


3 Answers

For future searchers (like me!), I had a similar problem trying to add the console plugin to my project. The missing step for me after installing the plugin was to make sure the source files of the plugin (CDVlogger.m) 'target membership' settings included my application names.

like image 66
Paul Avatar answered Sep 24 '22 05:09

Paul


Similar question with answer that worked for me:

remove ./plugins/ios.json to make sure the plugins are rebuilt.

Phonegap 3.0 IOS plugins not found

like image 23
Ska Avatar answered Sep 23 '22 05:09

Ska


I had the same issue. I just downloaded the cordova 3.0 command line tool using node's package manager. I then used the tool from Terminal to create my project, add platforms to it, and build it like this.

cordova create myApp com.project.RobertW myApp
cd myApp
cordova platform add ios
cordova platform add android
cordova build

After this I saw those same errors in Xcode when I tried to run it in the simulator. It seems by default now PhoneGap does not include any plugins in the project so even if there in your config file they probably won't be in the plugins folder. You have to add them manually or via the command line tool. I used the command line tool because I thought it was easier like so.

cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git
cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information.git
cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-console.git
cordova build

After doing this I ran myApp in the simulator again and everything worked fine. There are some good instructions on the command line tool here:

http://docs.phonegap.com/en/3.0.0/guide_cli_index.md.html#The%20Command-line%20Interface

I would like to think if PhoneGap 3.0 needs Logger, Device, and Network Status that it would include those plugins automatically but in my case it did not. Hope this helps.

Edit: In the config.xml for iOS version in Xcode, you'll also need to make this change to get the Logger plugin to work correctly. The following is the default.

<feature name="Console">
    <param name="ios-package" value="CDVLogger" />
</feature>

Change above to this

<feature name="Logger">
    <param name="ios-package" value="CDVLogger" />
</feature>

Now all your console functions should work without throwing errors.

like image 22
Robert-W Avatar answered Sep 22 '22 05:09

Robert-W