ios - 无法加载网页,错误为 : The operation couldn’t be completed. NSURLErrorDomain 错误 -999 将 Ionic 应用程序部署到 iOS 设备

标签 ios angular xcode firebase ionic4

我创建了一个可成功部署到 Android 的 Ionic 4 应用程序。它以前在部署到 iOS 时遇到问题,现在开始工作,它不会在 xcode 中再次部署到 iOS 并显示以下错误:

2019-09-09 20:28:09.836175-0400 [962:15259] Apache Cordova native platform version 5.0.1 is starting.
2019-09-09 20:28:09.836825-0400 [962:15259] Multi-tasking -> Device: YES, App: YES
2019-09-09 20:28:10.091156-0400 [962:15259] Using UIWebView
2019-09-09 20:28:10.094863-0400 [962:15259] [CDVTimer][console] 0.081062ms
2019-09-09 20:28:10.095080-0400 [962:15259] [CDVTimer][handleopenurl] 0.074029ms
2019-09-09 20:28:10.096599-0400 [962:15259] [CDVTimer][intentandnavigationfilter] 1.417994ms
2019-09-09 20:28:10.096769-0400 [962:15259] [CDVTimer][gesturehandler] 0.059962ms
2019-09-09 20:28:10.118206-0400 [962:15259] [CDVTimer][file] 21.324039ms
2019-09-09 20:28:10.118475-0400 [962:15259] GooglePlus pluginInitizalize
2019-09-09 20:28:10.118554-0400 [962:15259] [CDVTimer][googleplus] 0.204921ms
2019-09-09 20:28:10.118677-0400 [962:15259] [CDVTimer][TotalPluginStartup] 24.170041ms
2019-09-09 20:28:10.611689-0400 [962:15259] Resetting plugins due to page load.
2019-09-09 20:28:10.629519-0400 [962:15259] Failed to load webpage with error: The operation couldn’t be completed. (NSURLErrorDomain error -999.)
2019-09-09 20:28:10.632449-0400 [962:15259] Resetting plugins due to page load.
2019-09-09 20:28:11.564572-0400 [962:15511] NSURLConnection finished with error - code -1100
2019-09-09 20:28:11.565311-0400 [962:15515] NSURLConnection finished with error - code -1100
2019-09-09 20:28:11.565912-0400 [962:15511] NSURLConnection finished with error - code -1100
2019-09-09 20:28:11.566641-0400 [962:15511] NSURLConnection finished with error - code -1100
2019-09-09 20:28:11.567391-0400 [962:15515] NSURLConnection finished with error - code -1100
2019-09-09 20:28:11.567960-0400 [962:15511] NSURLConnection finished with error - code -1100
2019-09-09 20:28:11.816757-0400 [962:15259] Finished load of: file:///Users/anonymous/Library/Developer/CoreSimulator/Devices/9BB0D1E9-67AE-4A6A-94D0-1174FE78BA52/data/Containers/Bundle/Application/CADC7702-17A6-4138-A01C-5B7A3710A283/AppName.app/www/index.html

我在 StackOverflow 上浏览过类似的错误消息,但他们并没有真正提供针对此问题的任何解决方案。

我无法部署到模拟器或设备。

我的 appComponent 很简单:

  initializeApp() {
    firebase.initializeApp(firebaseConfig);

    this.platform.ready().then(() => {
        const unsubscribe = firebase.auth().onAuthStateChanged( user => {
          if (!user) {
            this.router.navigateByUrl('login');
            unsubscribe();
          } else {
            this.router.navigateByUrl('tabs');
            unsubscribe();
          }
        });
      this.statusBar.styleDefault();
      this.splashScreen.hide();
    });
  }

最佳答案

我通过cordova插件添加cordova-plugin-ionic-webview@latest解决了这个问题

关于ios - 无法加载网页,错误为 : The operation couldn’t be completed. NSURLErrorDomain 错误 -999 将 Ionic 应用程序部署到 iOS 设备,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57862705/

相关文章:

node.js - 使用nodejs将图像上传到文件服务器并存储图像的url

ios - 如何在标签栏 Controller View 内按下按钮时在标签栏下显示另一个 View Controller ?

iphone - Expedia 应用程序部分索引 : how they do that?

ios 11 - UIBarButtonItem 内的 UIButton 导致自动布局错误

ios - swift:在 Collection View 中的标签中显示进度

ios - ios 中需要左值作为赋值的左操作数

Swift View Controller 不会关闭

ios - UIView 不显示圆形

forms - Angular 2 : Can't bind to 'ngModel' since it isn't a known property of 'input'

angular - Angular `ngOnInit` 中的异步/等待