How do I fix this error?!?! error starting local server:

0 favourites
  • 4 posts
From the Asset Store
7 Errors
$15 USD
7 Errors is a game where you have to find the 7 mistakes before time runs out. Can you find all 7? Have fun looking.
  • We built a successful ios app using adobe phone gap and construct 2 without issues. Then, all the sudden, after one update we continually get this error any time we open the IOS app on any device...

    [quote:2drkhq2k]error starting local server: server is already up

    That error shows in a dialogue box and the app never runs thereafter.

    What is causing this bug for IOS? We suspect it was when we enabled the ADMIN LOCAL SERVER option in construct2 to view on the local network, but have not been able to reverse it.

    Our app does not require any server anything, it is a single player non-internet based app.

    game works fine on everything but IOS now due to this error... ugh!

    https://alphabetocean.boxels.com

  • I narrowed down this bug and found it is related entirely to enabling the LOCAL network server for testing on local network. This has hard coded an IPv4 address into the code somewhere, and this hard coded IPv4 address is what apple is crying about, as I have to hardcode an IPv6 as well if I have a IPv4 hard coded into the code.

    I've disabled the local network, turned it off in preferences (back to LOCALHOST) but this still occurs now with every Cordova export... please help. what to do. where is it in the exported code to remove or change?!?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I can confirm this error, if I find a solution, I will update it here.

    I couldn´t find any hardcoded ip adresses though, are you sure the preview is related to the error?

    The error occurs in the c2runtime.js, I can´t really make much out of it though.

    Ashley

    if (this.isWKWebView)
    		{
    			if (this.httpServer)
    			{
    				this.httpServer["startServer"]({
    					"port": 0,
    					"localhost_only": true
    				}, function (url)
    				{
    					self.httpServerUrl = url;
    					self.fetchLocalFileViaCordovaAsText("data.js", function (str)
    					{
    						self.loadProject(JSON.parse(str));
    					}, function (err)
    					{
    						alert("Error fetching data.js");
    					});
    				}, function (err)
    				{
    					alert("error starting local server: " + err);
    				});
    			}
    			else
    			{
    				this.fetchLocalFileViaCordovaAsText("data.js", function (str)
    				{
    					self.loadProject(JSON.parse(str));
    				}, function (err)
    				{
    					alert("Error fetching data.js");
    				});
    			}
    			return;
    		}[/code:37e6w085]
    
    I can´t really test it right now but since this only is executed if [b]this.isWKWebView[/b] is true, disabling WKWebView when exporting might do the trick. Maybe it´s an error with WKWebView rather than C2.
  • I can confirm this error, if I find a solution, I will update it here.

    I couldn´t find any hardcoded ip adresses though, are you sure the preview is related to the error?

    First off, Thank you for the reply, there is hope and we are not crazy as of yet!

    We believe (remember we are noob programmers, which is why we use Construct2) it is preview server related due to our only seeing this IOS issue after enabling that option in preferences (whatever it adds to our build for cordova?) and apple insisting we add both iPV6 and iPV4 addresses to fix the bug...

    apple's response from this sudden appearance of this new bug...

    viewtopic.php?f=151&t=189857

    We have reformatted our PC with a fresh windows 10 copy and a new Construct2 install (just to make sure it isn't related to settings in some rogue windows file from previous construct install) and the issue continues, suggesting that once the preference is enabled, it does something in the code (from our naive non-programmer perspective) no matter if we disable it afterwards and open the project on a fresh install of both Construct 2 and windows. It worked PERFECTLY BEFORE on IOS without issues.

    I will be tackling this again today, and wanted to try side by side in beta Construct 3, but it says we can't upgrade our construct 3 subscription as of yet? so free edition doesn't help us there to test.

    The last thing I'll test (a huge annoyance) is to redo the entire app in a new project, fresh install of Construct2 and Windows, without ever enabling that option to see if the error never pops up (due to never enabling preview server in preferences).

    I will also see what we get with your suggestion but am brand new to this WKWebView thing... and trying to make sense (as a noob programmer) of these threads to see if they are related to what we are seeing:

    issue-with-wkwebview-on-ios_t171504

    and...

    https://www.scirra.com/blog/ashley/25/h ... -wkwebview

    All noob explanations welcome. Thanks in advance. Will return and report after trying with disabled WKWebView on cordova export

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)