Error CorddovaLocalServer ,,, ios building webview+


#1

(ios building webview+) I open the game after the compilation, and there is a white screen and such an error

Error CorddovaLocalServer

what is the problem ?


#2

What game engine are you using?
Is it Construct 2 or Construct 3?


#4

construct 2 , You can help me ? ? ?


#5

Ok, good.
I experienced the same issue for my latest released game.

Just to be sure, are you using any third-party plugins that would need a Cordova plugin for building the iOS app?

Anyway, there is a very long story behind that black/white screen issue on iOS. It’s all happening since Scirra added the WKWebView on iOS option at export. You may read that post if you want to get more information: Black screen issued when test flight on iOS.

Regarding the solution, I just disabled WKWebView for iOS. My game is still fast, and the IPA size isn’t heavier. So, for now, that’s kind of a good work around.

Here is what I did:

  • In Construct 2, once you export your game for Cordova, don’t minify runtime.js and uncheck the option Use WKWebView on iOS (faster performance);
    175bfc6d5d696d296b7a7b3face2ce533d1fccc5
  • Unzip your downloaded game package, and go into the www/ folder. You should see that c2runtime.js file. Open it using your favorite text editor application;
  • In your c2runtime.js look for “WKWebView”. You should find a line of code like this: this.isWKWebView = !!(this.isiOS && this.isCordova);. It basically enables WKWebView for your game. You may disable it by changing that line of code with: this.isWKWebView = false;
  • Now, zip your www/ folder and upload it again to cocoon.io like you normally do;
  • Once you uploaded your game package to cocoon.io, go to the Plugins tab and add the following one to your project: cordova-plugin-file - This plugin is required for iOS only, and allows your game to read/write access to files residing on the device;
  • Also install this one: cordova-plugin-whitelist. Following its documentation: “It implements a whitelist policy for navigating the application webview on Cordova 4.0+”;
  • From here, you should be fine. Save your changes, and hit Compile button.

That’s basically how I made my game works on iOS and get over that blackscreen error.
If you want to see it live, head over: bikosaur.com.
I switched to Construct 3 back in December, and this solution also applies.

Let me know if you succeeded or if it failed.

Kr,
Antoine


#6

I did as you wrote, but it gives an error, what version of constructor 2 do you use?

here it is correctly made?


#7

I told you I’m now using latest version of Construct 3.
I’ve tried this solution with my latest C2 build, and it works.

Are you sure you use the latest stable version of C2?
What was the error it returned?

Yes, your default settings looks good except you should probably use a 3 digits version like x.x.x (e.g.: 0.0.34).

What are your iOS settings?
And, did you add all necessary cocoon plugins?


#8

Yes, added all the necessary plugins


#9

What is the error you got from cocoon while you compile?
iOS settings look good.
May I also ask you to provide a screenshot of the installed plugins, please?