我有更新到Xcode的6和iOS 8離子無法加載,錯誤的網頁:無法連接到服務器
當試圖運行項目我碰到下面的錯誤後,用離子項目的問題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.
即使試圖更新離子和科爾多瓦和開始一個新項目此錯誤不斷彈出。
我找不到有這個特定錯誤的任何線程,我不確定這是iOS 8的兼容性問題,還是有些東西與我的設置搞砸了。
謝謝!
編輯:
<!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(與其他編譯前:什麼是在index.html,然後app.js
的index.html
多一點信息使用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) {
}])
;
您是否驗證過要連接的服務器是否可用? – 2014-10-11 11:19:27
你需要向我們展示你的'index.html'是如何編碼的。需要提供更多信息? – frank 2014-10-11 13:07:03
@ScottHunter我有,但即使它不可用,應用程序的資源是本地離子應仍然加載,不應該嗎? – BarakChamo 2014-10-11 23:21:26