ionic-team / ionic-plugin-keyboard

Ionic Keyboard Plugin for Cordova
Apache License 2.0
610 stars 274 forks source link

TypeError: undefined is not an object (evaluating 'window.cordova.plugins.Keyboard') #132

Closed ronycohen closed 9 years ago

ronycohen commented 9 years ago

Hello, Thank you for your work ! I have a pb with the window.cordova.plugins.Keyboard. would you help me to solve it ?

On IOS I encounter this error, but not on Android. I wrapped correctly the call on

document.addEventListener('deviceready', function() {
                    angular.element(document).ready(function() {
                       angular.bootstrap(document.body, ['MyApp']);
                    });
}, false);

and I have the error in the run

        if(window.cordova && window.cordova.plugins.Keyboard) {
            cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
            cordova.plugins.Keyboard.disableScroll(true);
        }

I reinstalled several times the keyboard plugin. I succeed with a ionic state restore but it's suspicious... because I can't uninstall it :

 users-Mac:wa-user ron$ cordova plugin rm  ionic-plugin-keyboard
Uninstalling ionic-plugin-keyboard from ios
Removing "ionic-plugin-keyboard"
SyntaxError: Unexpected token v
    at Object.parse (native)
    at getJson (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/metadata.js:29:31)
    at Object.exports.remove_fetch_metadata (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/metadata.js:63:24)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/plugin.js:274:34
    at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)
    at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30)
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:749:13)
    at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:557:44
    at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:108:17)
    at process._tickCallback (node.js:355:11)
users-Mac:wa-user ron$ cordova plugin add ionic-plugin-keyboard
Fetching plugin "ionic-plugin-keyboard" via npm
SyntaxError: Unexpected token v
    at Object.parse (native)
    at getJson (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/metadata.js:29:31)
    at Object.exports.save_fetch_metadata (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/metadata.js:56:24)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/fetch.js:165:18
    at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)
    at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30)
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:749:13)
    at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:557:44
    at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:108:17)
    at process._tickCallback (node.js:355:11)
Your system information:
Cordova CLI: 5.3.1
Gulp version:  CLI version 3.8.11
Gulp local:   Local version 3.8.11
Ionic Version: 1.1.0
Ionic CLI Version: 1.6.4
Ionic App Lib Version: 0.3.8
ios-deploy version: Not installed
ios-sim version: 3.1.1 
OS: Mac OS X Yosemite
Node Version: v0.12.7
Xcode version: Xcode 6.4 Build version 6E35b 
ronycohen commented 9 years ago

Problem solved, I had the old plugin name in the package.json

zebap commented 7 years ago

me too facing the same issue which explained above

rameezkhwaja commented 7 years ago

hello that really solve my problem it was related with ionic keyboard which was not giving any error in xcode