ionic-team / ionic-plugin-keyboard

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

When installed on Windows, app crashes at startup #157

Open mavenius opened 8 years ago

mavenius commented 8 years ago

The tabs sample includes the following in app.js:

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

}

On Windows 10, an error occurs when

hideKeyboardAccessoryBar(true); 

is run. Commenting out this line allows the app to start up as expected. The behavior when the error happens is the splash screen shows for a moment, but then the app closes. An Information-level event appears in Windows Application Event Viewer with an Event Name of WWAJSE.

beatgrabe commented 8 years ago

I ran into the same issue. Solved by doing like below:

if( window.cordova && window.cordova.plugins && window.cordova.plugins.Keyboard ) {
    // Check reference to avoid runtime error on windows phone
    if( window.cordova.plugins.Keyboard.hideKeyboardAccessoryBar ) {
        cordova.plugins.Keyboard.hideKeyboardAccessoryBar( true );
    }
    cordova.plugins.Keyboard.disableScroll( true );
}
jmatthiesen commented 8 years ago

I, and other developers I work with, see this often, too. I know that the code in the first post here is the same as the default source in Ionic templates. So, either the Ionic templates should change to use the pattern from the @beat-at-hartwig response, or perhaps the hideKeyboardAccessoryBar function should be implemented for the Windows platform, even if it's just a function that does nothing?

albertogallen commented 8 years ago

I continue with the same issue

don't work for my ionic app :-\

bouchja1 commented 8 years ago

I have also the same problem as @agallen . The solution from the @beat-at-hartwig works only for really simple Ionic application (for example generated tabs app).

patronovski commented 8 years ago

Any progress on this issue?

mackevicius1988 commented 7 years ago

I have the same problem. Maybe someone has luck??