Android 首次在手机上运行Ionic应用程序时无法加载键盘?
我的手机似乎无法使用键盘Android 首次在手机上运行Ionic应用程序时无法加载键盘?,android,cordova,keyboard,ionic,Android,Cordova,Keyboard,Ionic,我的手机似乎无法使用键盘 Failed to load resource: net::ERR_FILE_NOT_FOUND app.js:9 Uncaught TypeError: Cannot read property 'Keyboard' of undefined 我发现这很奇怪,因为除了空白模板之外,我还没有添加任何键盘功能: angular.module('mymobile') .run(['$ionicPlatform', function($ionicPl
Failed to load resource: net::ERR_FILE_NOT_FOUND
app.js:9 Uncaught TypeError: Cannot read property 'Keyboard' of undefined
我发现这很奇怪,因为除了空白模板之外,我还没有添加任何键盘功能:
angular.module('mymobile')
.run(['$ionicPlatform',
function($ionicPlatform) {
$ionicPlatform.ready(function() {
if(window.cordova && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
}
if(window.StatusBar) {
StatusBar.styleDefault();
}
});
}]);
我在谷歌上找到了这类主题的答案,我应该安装cordova插件白名单
,但它已经默认安装了。我还看到安装了爱奥尼亚插件键盘
我还根据另一条建议将此元标记添加到index.html:
<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'">
这个xml标签就在config.xml中的
上方。文章中的操作,再加上重新安装node.js、cordova、ionic和安装更多Android SDK软件包,解决了这个问题。我不确定哪些行动是决定性的