在更新到
Xcode 6和iOS 8之后,我遇到了Ionic项目的问题.
当尝试运行项目时,我在Xcode中收到以下错误:
- Failed to load webpage with error: Could not connect to the server.
完整的日志是:
- 2014-10-11 14:08:29.468 test[23293:109668] Apache Cordova native platform version 3.6.3 is starting.
- 2014-10-11 14:08:29.469 test[23293:109668] Multi-tasking -> Device: YES,App: YES
- 2014-10-11 14:08:29.495 test[23293:109668] Unlimited access to network resources
- 2014-10-11 14:08:29.866 test[23293:109668] [CDVTimer][keyboard] 0.079989ms
- 2014-10-11 14:08:29.866 test[23293:109668] [CDVTimer][TotalPluginStartup] 0.284970ms
- 2014-10-11 14:08:30.721 test[23293:109668] Resetting plugins due to page load.
- 2014-10-11 14:08:30.764 test[23293:109668] Failed to load webpage with error: Could not connect to the server.
即使尝试更新Ionic和Cordova并开始一个新项目,这个错误也不断出现.
我找不到任何线程与这个特定的错误,我不知道这是否是一个iOS 8兼容性问题或某些东西搞砸了我的设置.
谢谢!
编辑:
更多关于index.html和app.js中的内容的信息
index.html的:
- <!DOCTYPE html>
- <html ng-app="app" ng-controller="AppCtrl">
- <head>
- <Meta charset="utf-8">
- <Meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no,width=device-width">
- <!-- compiled CSS -->
- <link rel="stylesheet" type="text/css" href="assets/app-0.0.1.css" />
- <!-- compiled JavaScript -->
- <script type="text/javascript" src="src/app/app.js"></script>
- <!-- cordova script (this will be a 404 during development) -->
- <script src="cordova.js"></script>
- </head>
- <body >
- <ion-nav-view></ion-nav-view>
- <!-- Load deferred scripts -->
- <!-- Google Maps -->
- <script src='http://maps.googleapis.com/maps/api/js?sensor=true&callback=googleMapsLoaded' defer async></script>
- </body>
- </html>
和app.js(在使用ngbp编译其余的文件之前):
- angular.module( 'app',[
- 'ionic',// Common requirements
- 'templates-app','templates-common',// Common Components
- 'app.auth',// All page modules
- 'app.businesses','app.business','app.search','app.branch','app.profile','app.Feed',// Other dependencies
- 'ui.router'
- ])
- .config(['$stateProvider','$urlRouterProvider',function myAppConfig ($stateProvider,$urlRouterProvider) {
- $stateProvider
- .state('app',{
- url: "/app",abstract: true,templateUrl: "menu/menu.tpl.html",controller: 'AppCtrl'
- });
- $urlRouterProvider.otherwise( 'app/Feed' );
- }])
- .run(['$ionicPlatform','appAuthService','$sessionStorage',function($ionicPlatform,appAuthService,$sessionStorage) {
- // Initialize ionic styles
- $ionicPlatform.ready(function() {
- if(window.StatusBar) {
- // org.apache.cordova.statusbar required
- StatusBar.styleDefault();
- StatusBar.styleLightContent();
- }
- });
- // Initialize app authentication service
- appAuthService.init();
- // Initialize a session cache validation object
- $sessionStorage.updated = {};
- }])
- .controller( 'AppCtrl',['$scope','$location',function AppCtrl ($scope,$location) {
- }])
- ;