简体   繁体   English

离子无法建立cordova.js

[英]Ionic not founding cordova.js

When I ionic serve , my main page console shows me this error: 当我ionic serve ,我的主页控制台会向我显示此错误:

ng-cordova-beacon.js:53 Uncaught ReferenceError: cordova is not defined
at Object.requestWhenInUseAuthorization (ng-cordova-beacon.js:53)
at app.js?ionicCachebuster=10643:25
at Array.<anonymous> (ionic.bundle.js?ionicCachebuster=10643:56238)
at onPlatformReady (ionic.bundle.js?ionicCachebuster=10643:2496)
at onWindowLoad (ionic.bundle.js?ionicCachebuster=10643:2477)

But in the html's page there is: 但是在html的页面中有:

<!-- ionic/angularjs js -->
<script src="lib/ionic/js/ionic.bundle.js?ionicCachebuster=10643"></script>

<!-- cordova script (this will be a 404 during development) -->
**<script src="cordova.js"></script>**
<script src="js/ng-cordova-beacon.js"></script>

Anyone can help me? 有人可以帮助我吗? ;) ;)

Cordova is not available on browser(as you can see in html file, cordova will be 404 during developmet). Cordova在浏览器上不可用(如您在html文件中所见,cordova在开发期间为404)。 If you are using any cordova plugins or ionic native plugins, you have to test that application in real device. 如果您使用任何cordova插件或ionic native插件,则必须在真实设备中测试该应用程序。

Android: Android:

ionic platform add android
ionic build android
ionic run android

ios: ios:

ionic platform add ios
ionic build ios
ionic run ios

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM