Update on Cordova apps on iOS 10

Discussion and feedback on Construct 2

Post » Fri Sep 30, 2016 11:15 pm

I have the same issue. exported new project in intel -> ipad 9 and get a white screen about 10secs after the game start
B
33
S
8
Posts: 62
Reputation: 2,043

Post » Sun Oct 02, 2016 7:01 pm

@cristiart - please file a bug following all the guidelines so we can investigate.
Scirra Founder
B
387
S
230
G
88
Posts: 24,251
Reputation: 192,454

Post » Mon Oct 03, 2016 10:57 am

Hi,

I'm also struggling with iOS 10 & Cordova (+cocoon.io & cocooncanvasplus plugin)

When I do a simple cordova export, my app only displays a blank screen on iOS 10 (but works on iOS 8 & 9)

If I change this in c2runtime.js
this.isWKWebView = !!(this.isiOS && this.isCordova && window.indexedDB);
to:
this.isWKWebView = false;

My app is working on iOS 10, but then the screen scale is displayed incorrectly
http://i.imgur.com/uUOixFs.png

My project settings:
http://i.imgur.com/zwMD3lw.jpg
(using C2 r233 64bits)

I'm not sure how to enable WKWebView, should I just check the box in the Cordova export option ?
Should I also change the line in c2runtime.js to this.isWKWebView = true; ?
Do I have anything to do with Cocoon ?
Or is there any other way to make my app working correctly without WKWebView on iOS 10 ?
Thank you
Lunar Mission for Android & iOS
B
16
S
2
Posts: 44
Reputation: 1,365

Post » Mon Oct 03, 2016 3:29 pm

@johnsmith - note the non-webview Cocoon platforms have been deprecated for a long time now so have not been supported for some time. I don't know if that's what you're using?

Anyways, it turns out there's another obscure property we can rely on to detect WKWebView. Apparently Cordova detects it the same way, so if iOS 11 breaks it, it will break all Cordova apps, not just our own :P Hopefully that is good enough for the future. So the next build actually brings back the "enable WKWebView" and "use new Intel XDK project format" options. I still strongly recommend using WKWebView where possible, since it is significantly faster!
Scirra Founder
B
387
S
230
G
88
Posts: 24,251
Reputation: 192,454

Post » Mon Oct 03, 2016 4:11 pm

Ashley wrote:@johnsmith - note the non-webview Cocoon platforms have been deprecated for a long time now so have not been supported for some time. I don't know if that's what you're using?


I'm not using the old cocoon exporter since it's been deprecated, the new cocoon.io only requires a Cordova export from C2 along with the appropriate cocoon plugins in the project (which can be found here: https://github.com/CocoonIO/cocoon-plugins-c2 ).

In the cocoon.io compiler, I'm using the webview engine: Canvas+ (and so the CocoonCanvasPlus plugin in my C2 project)
http://docs.cocoon.io/article/webview-engines-differences/
Is my screen scaling problem when WKWebview is disabled more related to Cocoon than Construct 2 (or Cordova) ?
Lunar Mission for Android & iOS
B
16
S
2
Posts: 44
Reputation: 1,365

Post » Fri Oct 14, 2016 10:02 am

Just a heads up. My game (https://itunes.apple.com/app/id1088622798) was working on iOS 9, and even iOS 10.0.1 (didn't get black screen or other issues surprisingly!) but the latest 10.0.2 now causes it to hang at the loading bar.

I'm updating it and trying the latest C2 beta build, along with updated XDK & Cordova, was using 5.4.1 and now I see a new 6.2 is available, along with a 1.03 WKWebView plugin... will report back tomorrow on the testing.
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,614

Post » Fri Oct 14, 2016 11:50 am

Tested it with Cordova 6.2, WKWebView 1.1.0 (the latest) Cordova plugin in XDK.

I am stuck at the loading progress bar, however, some launches it will go all the way and start the game up. Once into the game, it runs fine.

I notice in the c2runtime.js there's this line:

this.setImageSrc(img_, src_); // work around WKWebView problems

and..

if (this.runtime.isWKWebView)
playMusicAsSoundWorkaround = true;

Obviously a hack/workaround to a prior problem.. :)

Also the detection has changed somewhat?

this.isWKWebView = !!(this.isiOS && this.isCordova && window["webkit"]);

^ I am going to test changing it to true;

Because I don't need to check, the build uses WKWebView plugin and set for iOS9+ only.

Edit: Changing that to true; causes it to hang at the start of loading again (most of the time, some launches work as before). Going to try setting it to false; ... I have a feeling some WKWebView work-around for prior iOS versions/Cordova is no longer required in iOS10+ or no longer functional. This isn't a detection of WKWebView problem!!
Last edited by Silverforce on Fri Oct 14, 2016 12:36 pm, edited 4 times in total.
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,614

Post » Fri Oct 14, 2016 12:25 pm

So, I've got about as far as I possibly can on my own trying to fix this issue, so I really need some help. I ask that we try and have a discussion about possible causes for these errors rather than filing a bug report, I've wasted days trying to fix this and if I hear the phrase 'file a bug report' I'll probably have a mental breakdown...anyway...

My game (https://itunes.apple.com/gb/app/the-sla ... 1056603685) is unplayable using WKWebView. Before iOS10 was released, I got around this by compromising and using UIWebView. With iOS10 this is no longer an option as my game simply wont run. I'll talk you through what happens when I try to run with WKWebView:

• The game's start menu loads normally.
• I choose the new game option.
• The game successfully goes to my loading layout which I use to show the words 'one second...' before moving to the next layout.
• The next layout loads but the game only shows the black loading layout with the words 'one second..' frozen on the screen. I can tell the next layout is working fine because all the sound and music is working, and it even accepts touch so the game can be played but the visuals are frozen.
• Simple non cpu/gpu intensive layouts like my world map load normally.
• Using the first layout for testing, I've tried disabling all events and the visual still freezes simply trying to load the images in the layout.
• The layout only works when I delete all but about 5 objects.
• I've tried creating the images needed for the next layout every few milliseconds in the loading layout before moving to the next layout but this still freezes once the layout changes.
•Out of simple curiosity I've tried exporting with webGL off, this causes each layout to show the complete sprite sheets for every object in the layout, peculiar!

Not being very technical, my guess would be that something WKWebView does causes a huge spike in cpu or gpu (I know @Ashley has previously said there is no gpu difference between UI and WK but are you 100% sure?) and this causes the visuals to freeze.

Is there not a more efficient way to load each layout in c2? Most games have a loading screen between each scene, whereas c2 seems to just create everything at the same time regardless of whether this makes the game hang, I'm sure we've all seen crazy cpu jumps for a second at the start of each layout, surely this isn't a healthy way of working?

In regards to your post @Silverforce, I've found that when I add a new build on TestFlight and try to play it, the loading bar usually hangs half way and I have to close and restart it before it works. This obviously isn't great as if the same problem occurs for users they might just conclude that the game doesn't work and get a refund.

I can't stress how important I think it is for the c2 team to talk to developers more, especially going forward with construct 3. The test games Scirra uses for benchmarks like Space Blaster are far too simple, you guys need to work with devs to test their actual games, or at least use examples that use large images, sound, and actual layout transitions rather that just one, then we might have known about things like the object limitations of Mac and Linux when using nw.js beforehand. It's all well and good making a great piece of game dev software, which c2 most definitely is, but once it gets to the exporting stage it becomes an absolute nightmare. I can't even count the days I've wasted, hoops I've had to jump through, insane things I've had to figure on my own, and technical posts I've had to decipher in the depths of obscure html5 forums over the last 3 years. These aren't things you should have to do when you've chosen to use a piece of software specifically because you can't code, like I have. Take this small example; every time I export a project for cordova, I have to edit the config and add this below the icon lines or I'll run into an error when uploading with XCode Application Loader for iOS games:

<icon src="icon-120.png" gap:platform="ios" width="120" height="120" />
<icon src="icon-152.png" gap:platform="ios" width="152" height="152" />
<icon src="icon-76.png" gap:platform="ios" width="76" height="76" />
<icon src="icon.png" gap:platform="ios" width="57" height="57" />

I literally have done this so much it's second nature, it's ridiculous, why isn't this just a part of the generated config file already? Something like this could permanently stop a user less technically competent than myself, and I'm no coder.

That really is a tiny example, it's a shame as the people who are really using the software to its fullest potential are the ones getting burned the worst, from @Aurel having to discontinue Linux support for The Next Penelope to @Silverforce having their games break with every iOS update! Sorry to rant, I do respect the work Scirra does enormously but I'm just fed up of always looking for answers and seeing every thread end with either; file a bug report, or the dismissive line; we've tested it on this tiny one layout test game and it works fine therefore it should work fine for your game. Users being able to export to the most popular platforms with ease should be a top priority for Scirra, up to this point in time, devs have had to take it upon themselves to create or find plugins and workarounds to do the most simplest of tasks; releasing their game.

Anyway, if anyone has any ideas please do let me know.
B
11
S
3
Posts: 135
Reputation: 1,309

Post » Fri Oct 14, 2016 12:58 pm

AlexFrancois wrote:The test games Scirra uses for benchmarks like Space Blaster are far too simple, you guys need to work with devs to test their actual games, or at least use examples that use large images, sound, and actual layout transitions rather that just one, then we might have known about things like the object limitations of Mac and Linux when using nw.js beforehand.


Damn straight this.

Big C2 games will NOT work on MAC at all, period. Linux export is broken since forever, but honestly I haven't tried it since NW 0.14 so I don't know if it's finally fixed.

However, it's quite clear this is all related to 3rd party wrappers. NWjs is just broken on MAC with a big project due to being treated like a browser (which isn't supposed to "load so many files", and it's a known bug for years!!). The mobile exporters are worse in their reliance on 3rd parties.

I would pay a LOT for an engine with C2's event system and native export. We don't need so many damn platforms, just PC/MAC/Linux for the desktop and Android + iOS.

Back to testing..

Setting

this.isWKWebView = false;

Now results in a blackscreen, not even a loading bar.

So definitely that ain't the fix!

Again, this isn't a WKWebView detection problem, this is related to asset loading somehow..

If @Ashley wants a bigger game CAPX for debug/compatibility/performance testing, I can volunteer mine. The title screen itself has a huge battle, multiple different faction fleets, including capitals and carriers for a lot of sprite, particles, and AI/logic. Let me know!
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,614

Post » Fri Oct 14, 2016 1:21 pm

Silverforce wrote:I would pay a LOT for an engine with C2's event system and native export.


Totally agree with this, the brilliant event system is only let down by the exporting, would be near perfect otherwise.

I unfortunately had the same results after setting this.isWKWebView = false;
B
11
S
3
Posts: 135
Reputation: 1,309

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 1 guest