Skip to content
This repository has been archived by the owner on May 4, 2022. It is now read-only.

Changes to support iPhone X to ionic-v1 App give a "Not found" error #356

Open
stib opened this issue Dec 29, 2017 · 3 comments
Open

Changes to support iPhone X to ionic-v1 App give a "Not found" error #356

stib opened this issue Dec 29, 2017 · 3 comments

Comments

@stib
Copy link

stib commented Dec 29, 2017

Short description of the problem:

I moved to Xcode 9.2 and am trying to make changes to my ionic-v1 app to handle iPhone X properly. I have made the changes suggested by @mlynch in ticket 317 on Sep 28. I have followed the instructions in the linked iOS 11 blog.

At the end I have removed and added ios platform back to the App to clean things up.

When I try to run the App on the simulator through XCode it gives the error below in the images. Before the updates the App was coming up fine only had the iPhone X related display issues with white bars.

iphone-6 plus simulator
image

iphone X simulator
image

What behavior are you expecting?

I checked the referenced directory and there is nothing there in the end directory. Not sure if the index.html that the code is looking for is supposed to be there and if so how does it get there. I have tried removing and adding the ios platform a few times.

Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)

Which Ionic Version? 1.x or 2.x
1.x (1.3.5) though ionic info output below seems to think it is 1.3.1 which may be an indicator of the problem.

Plunker that shows an example of your issue

Run ionic info from terminal/cmd prompt: (paste output below)
[WARN] Error with ./www/lib/ionic/version.json file: FILE_NOT_FOUND, trying ./bower.json.

cli packages: (/Users/stibrewal/.nvm/versions/node/v6.9.1/lib/node_modules)

@ionic/cli-utils  : 1.19.0
ionic (Ionic CLI) : 3.19.0

global packages:

cordova (Cordova CLI) : 7.1.0 

local packages:

Cordova Platforms : android 6.4.0 ios 4.5.4
Ionic Framework   : ionic1 1.3.1

System:

Android SDK Tools : 25.2.5
ios-deploy        : 1.9.0 
ios-sim           : 5.0.11 
Node              : v6.9.1
npm               : 3.10.8 
OS                : macOS High Sierra
Xcode             : Xcode 9.2 Build version 9C40b 

Environment Variables:

ANDROID_HOME : /usr/local/bin/android-sdk-macosx

Misc:

backend : pro

Couple things look odd here. Per the instructions to support iPhone X I ran the following command bower install ionic-team/ionic-bower#1.3.5 and I see in my lib/ionic/js/ionic.js that the version is " * Ionic, v1.3.5" but the ionic info command above seems to think it is 1.3.1 which is what I had earlier but doesn't show the updated version.

Also there seems to be a missing ./www/lib/ionic/version.json file though the bower.json file at the root has the following. I don't understand why there are both 1.3.1 and 1.3.5 entries there.

{
  "name": "HelloIonic",
  "private": "true",
  "devDependencies": {
    "ionic": "driftyco/ionic-bower#1.3.1"
  },
  "resolutions": {
    "ionic": "1.3.5"
  }
}

Also the name "HelloIonic" seems wrong. I replaced that with the App name GroupTrac and tried but get the same result.

Thanks,
Sanjay.

(Edit: cordova build ios completes successfully)

@stib
Copy link
Author

stib commented Jan 1, 2018

Some additional pieces of information I found in trying to debug.

  1. The project updated with iPhone X changes gives this "Not Found" error on Simulators including older simulators like iPhone 6 plus. But running the app on the actual device (iPhone 6 plus) runs fine. I don't yet have a iPhone X to try the app on the actual device
  2. Running a copy of the earlier version of the App (before iPhone X related changes) runs on the Simulator with the iPhone X related issues - doesn't give the "Not Found" error as in the updated project.

So the error seems to be confined to the updated project and for Simulators.

Not sure why that is the case or what I can do to address.

Thank you for any pointers.
Sanjay.

@stib
Copy link
Author

stib commented Jan 7, 2018

In continuing to debug this problem I noticed that when I run the simulator (iPhone X or iPhone 6+) I get the following output in XCode (9.2)

2018-01-07 13:27:02.415582-0800 GroupTrac[1965:17786] Apache Cordova native platform version 4.5.3 is starting.
2018-01-07 13:27:02.416470-0800 GroupTrac[1965:17786] Multi-tasking -> Device: YES, App: YES
[ERROR] Failed binding IPv4 listening socket: Address already in use (48)
2018-01-07 13:27:02.434555-0800 GroupTrac[1965:17786] CDVWKWebViewEngine: trying to inject XHR polyfill
2018-01-07 13:27:02.556747-0800 GroupTrac[1965:17786] [MC] Lazy loading NSBundle MobileCoreServices.framework
2018-01-07 13:27:02.558109-0800 GroupTrac[1965:17786] [MC] Loaded MobileCoreServices.framework
2018-01-07 13:27:02.565425-0800 GroupTrac[1965:17786] CDVWKWebViewEngine will reload WKWebView if required on resume
2018-01-07 13:27:02.565584-0800 GroupTrac[1965:17786] Using Ionic WKWebView
2018-01-07 13:27:02.566133-0800 GroupTrac[1965:17786] [CDVTimer][console] 0.133038ms
2018-01-07 13:27:02.566456-0800 GroupTrac[1965:17786] [CDVTimer][handleopenurl] 0.147939ms
2018-01-07 13:27:02.569146-0800 GroupTrac[1965:17786] [CDVTimer][intentandnavigationfilter] 2.516031ms
2018-01-07 13:27:02.569538-0800 GroupTrac[1965:17786] [CDVTimer][gesturehandler] 0.120044ms
2018-01-07 13:27:02.569789-0800 GroupTrac[1965:17786] [CDVTimer][backgroundfetch] 0.102997ms
2018-01-07 13:27:02.572888-0800 GroupTrac[1965:17786] [CDVTimer][cordovagooglemaps] 2.957940ms
2018-01-07 13:27:02.611618-0800 GroupTrac[1965:17786] [CDVTimer][splashscreen] 38.527966ms
2018-01-07 13:27:02.618549-0800 GroupTrac[1965:17786] [CDVTimer][statusbar] 6.750941ms
2018-01-07 13:27:02.618856-0800 GroupTrac[1965:17786] [CDVTimer][selectorcordovaplugin] 0.108957ms
2018-01-07 13:27:02.621013-0800 GroupTrac[1965:17786] [CDVTimer][keyboard] 1.801968ms
2018-01-07 13:27:02.621426-0800 GroupTrac[1965:17786] [CDVTimer][TotalPluginStartup] 55.418968ms
2018-01-07 13:27:02.633182-0800 GroupTrac[1965:17786] createNotificationChecker
2018-01-07 13:27:02.633347-0800 GroupTrac[1965:17786] not coldstart
2018-01-07 13:27:02.678910-0800 GroupTrac[1965:17786] active
2018-01-07 13:27:02.679973-0800 GroupTrac[1965:17786] PushPlugin skip clear badge

I get the "Not Found" error after this point and the App stops. I have highlighted an ERROR I see here.

When I run the same code on real device (iPhone 6+ - OS 10.2.1) I get the following output in XCode and App starts off fine.

2018-01-07 13:29:39.083660 GroupTrac[12421:5003659] [DYMTLInitPlatform] platform initialization successful
2018-01-07 13:29:39.319849 GroupTrac[12421:5003494] Apache Cordova native platform version 4.5.3 is starting.
2018-01-07 13:29:39.321773 GroupTrac[12421:5003494] Multi-tasking -> Device: YES, App: YES
2018-01-07 13:29:39.359380 GroupTrac[12421:5003494] CDVWKWebViewEngine: trying to inject XHR polyfill
2018-01-07 13:29:39.540312 GroupTrac[12421:5003494] CDVWKWebViewEngine will reload WKWebView if required on resume
2018-01-07 13:29:39.540449 GroupTrac[12421:5003494] Using Ionic WKWebView
2018-01-07 13:29:39.541282 GroupTrac[12421:5003494] [CDVTimer][console] 0.208020ms
2018-01-07 13:29:39.541845 GroupTrac[12421:5003494] [CDVTimer][handleopenurl] 0.297070ms
2018-01-07 13:29:39.547278 GroupTrac[12421:5003494] [CDVTimer][intentandnavigationfilter] 5.282044ms
2018-01-07 13:29:39.547736 GroupTrac[12421:5003494] [CDVTimer][gesturehandler] 0.304937ms
2018-01-07 13:29:39.547981 GroupTrac[12421:5003494] [CDVTimer][backgroundfetch] 0.136018ms
2018-01-07 13:29:39.551670 GroupTrac[12421:5003494] [CDVTimer][cordovagooglemaps] 3.528953ms
2018-01-07 13:29:39.578751 GroupTrac[12421:5003494] [CDVTimer][splashscreen] 26.935101ms
2018-01-07 13:29:39.598236 GroupTrac[12421:5003494] [CDVTimer][statusbar] 19.309998ms
2018-01-07 13:29:39.598811 GroupTrac[12421:5003494] [CDVTimer][selectorcordovaplugin] 0.396013ms
2018-01-07 13:29:39.601519 GroupTrac[12421:5003494] [CDVTimer][keyboard] 2.541065ms
2018-01-07 13:29:39.601685 GroupTrac[12421:5003494] [CDVTimer][TotalPluginStartup] 60.734987ms
2018-01-07 13:29:39.612960 GroupTrac[12421:5003494] createNotificationChecker
2018-01-07 13:29:39.613031 GroupTrac[12421:5003494] not coldstart
2018-01-07 13:29:39.614466 GroupTrac[12421:5003494] active
2018-01-07 13:29:39.615897 GroupTrac[12421:5003494] PushPlugin skip clear badge
2018-01-07 13:29:42.555356 GroupTrac[12421:5003494] Exiting login
2018-01-07 13:29:42.701849 GroupTrac[12421:5003494] THREAD WARNING: ['StatusBar'] took '22.020020' ms. Plugin should use a background thread.

There are two things I notice. First is the ERROR in the simulator
[ERROR] Failed binding IPv4 listening socket: Address already in use (48)
I tried Googling it but there isn't much there.

Second is that the simulator seems to fail (compared to the log from running it on real device) before the statusbar plugin starts. I tried removing the plugin for Simulator but get the same result.

I am not quite sure what to do next to debug this problem. Look forward to help from this community.

Thanks,
Sanjay.

@mnasyrov
Copy link

mnasyrov commented Jan 18, 2018

I faced with the same issue and found that an app spin off a built-in web server which serves www files. Thus when an app is run in emulator the server may conflict with another app on a host machine which also binds to 8080 port. In my case there was a dev web server which was run before.

You should check if some app binds to 8080 port on your machine. I suppose that two iOS emulator might conflict with each other as well.

Anyway, I think that a port of the built-in web server should be configurable at least.

My environment:

  • ionic-angular: 3.9.2
  • cordova: 8.0.0
  • cordova-ios: 4.5.4
  • cordova-plugin-ionic-webview: 1.1.16

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants