2014-10-11 71 views
20

我有更新到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) { 

}]) 

; 
+0

您是否验证过要连接的服务器是否可用? – 2014-10-11 11:19:27

+0

你需要向我们展示你的'index.html'是如何编码的。需要提供更多信息? – frank 2014-10-11 13:07:03

+0

@ScottHunter我有,但即使它不可用,应用程序的资源是本地离子应仍然加载,不应该吗? – BarakChamo 2014-10-11 23:21:26

回答

69

我有同样的问题。

我通过Xcode在平台文件夹中打开了ios项目,但我忘记了Xcode文件夹中的代码库不是最新的,因此破坏了。

为了让您的Xcode项目的新代码中使用命令:

ionic prepare ios 

如果您的问题植根于我的一样这应该帮助。

+2

这也解决了它对我来说,但在Ionic 2测试版11. – DarkNeuron 2016-08-15 11:24:43

+0

非常感谢..这是工作 – CodeWriter 2018-01-14 17:48:31

+2

在新版本的离子cordova准备ios' – Chumillas 2018-02-20 18:05:19

相关问题