Scirra / Construct-bugs

Public bug report submissions for Construct 3 and Construct Animate. Please read the guidelines then click the 'Issues' tab to get started.
https://www.construct.net
107 stars 83 forks source link

Ads make everything transparent #1692

Closed MonDieu72 closed 6 years ago

MonDieu72 commented 6 years ago

Problem description

When I try to load ads on my Samsung Galaxy S7, everything becomes transparent and vanishes.

Attach a .c3p

testproject A minimal Construct 3 project (.c3p) is required to be attached. Please see the guidelines

Steps to reproduce

  1. Insert admob info into admob plugin
  2. Compile a debug apk
  3. Install on device and test

Observed result

When I try to load ads everything becomes transparent and vanishes.

Expected result

It should display test ads

Affected browsers

System details

If you see a crash report dialog, please copy and paste it to where it says "PASTE HERE" below. Otherwise please go to Menu -> About -> Platform information and paste that information there instead.

View details PASTE HERE
hansonbrody commented 6 years ago

I just published an app update (last one was about a month ago) and I'm getting reports from a number of Samsung users that many of the layouts are showing up as blank screens. Unfortunately I can't replicate it on my device. I'm using ads as well. Not sure if its related to this issue, but maybe.

shortercode commented 6 years ago

Have you added the additional information for the user consent dialog?

I have been testing on an S8 in the office without issue

On Wed, 13 Jun 2018, 19:19 hansonbrody, notifications@github.com wrote:

I just published an app update (last one was about a month ago) and I'm getting reports from a number of Samsung users that many of the layouts are showing up as blank screens. Unfortunately I can't replicate it on my device. I'm using ads as well. Not sure if its related to this issue, but maybe.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/Scirra/Construct-3-bugs/issues/1692#issuecomment-397036630, or mute the thread https://github.com/notifications/unsubscribe-auth/AIoe2dp7haiz4gXg463vohsihU3k2PqRks5t8VfOgaJpZM4Uk0L2 .

MonDieu72 commented 6 years ago

I have tested the same project on my older Samsung Galaxy Tab S (from late 2014) and on that it works without the described issues.

hansonbrody commented 6 years ago

I also can't replicate the issue in the c3p @MonDieu72 attached, but there's definitely something funny somewhere with the Ads. I've confirmed several of my users are having this happen (blank screen) when the 'Create Interstitial Ad' event is invoked (this happens at the beginning of my layout with show = false). They are on various Samsung devices, including, A5, S6, and S7. I am testing on an S6 and can't replicate. Don't have this issue with the iOS version, which is the same thing only with different ad units/app id.

MonDieu72 commented 6 years ago

Some further observations: If I replace the button sprites with "regular" buttons in the c3p the buttons do not disapear but everything else does, super weird. Could the version of android used have anything to do with it? My S7 (where the problems happen) just got updated to oreo 8.0 and my old tab s is running 6.0. Just a thought.

hansonbrody commented 6 years ago

I'm stumped. My test phone is running v7.0 and things work. Some users that are having issues are also running 7.0, and it doesn't work. @shortercode mentioned the user consent info but my app is only available in Canada so I don't think that applies. Or maybe Construct enforces that I still need it?

hansonbrody commented 6 years ago

image

hansonbrody commented 6 years ago

There's a thread in the forums that's describing some white/blank screen issues with ads on samsungs...

MonDieu72 commented 6 years ago

this really needs to be fixed since samsung alone holds over 22% of the global smartphone market

hansonbrody commented 6 years ago

This is definitely a tricky one, as it seems that some Samsung device/OS combinations work and some don't. Not an easy bug puzzle for @shortercode to figure out since he can't replicate it (and neither can I, I just have a few dozen angry messages in my Facebook page inbox from people who can't play the game since I published this last update yesterday).

Brainstorming here, maybe there's some setting in the device that's problematic rather than the device itself. Perhaps, for example, Samsung devices that have location enabled are causing the issue, and that's the root cause of the problem rather that a specific OS version or device....?

MonDieu72 commented 6 years ago

I think there must be something strange either in Construct3 it self or the way apk's are compiled in their export service

MonDieu72 commented 6 years ago

this game works fine on my S7: https://www.construct.net/se/forum/construct-2-creations/completed-creations-23/little-skaters-on-ios-and-andr-133945

hansonbrody commented 6 years ago

What country are you in?

MonDieu72 commented 6 years ago

Sweden :)

hansonbrody commented 6 years ago

Ha, I was going to ask, if you were in Canada or the US, to download and try my apps with your problem phone, but that won't work from Sweden. However, on another note, I met with a trade ambassador for Sweden about a month ago who brought me up to speed on how awesome the gaming industry is in your country. My email is hansonbrody@gmail.com, ping me so we can chat offline and leave this thread for this weird ad bug that I'm pretty sure exists...somewhere.

MonDieu72 commented 6 years ago

ok I will but now i'll have to get some sleep before work and it is 04.20 am here yawn :)

shortercode commented 6 years ago

Hey guys, I will obviously do everything I can to fix this, and any help you can provide is definitely appreciated.

In terms of the user consent requirements; I'd need to double check the code but I think it currently requires you to fill in the additional information ( app id, pub id, privacy policy ).

If your not publishing in the EEA then the privacy policy URL won't be shown, so that can be a dummy if need be. Google's user consent dialog requires you to use a custom provider list with a maximum of 12 providers, again this is for the dialog so if your publishing outside the EEA you shouldn't need to do this.

However, it's worth saying that the dialog will be shown if the user is inside the EEA, or if it's unknown where the user is. So I'd say it's a good idea to presume that you will need it. That's the behaviour of the SDK Google have provided, not something we chose to do.

If your previous versions worked fine it's pretty likely that whatever this problem is it's either related to a new version of the AdMob SDK or the user consent changes. So you might be able to workaround it by publishing with an older version, r101 or earlier don't include the user consent code.

If you need to downgrade a project to work with r101 I can let you know how to do it, but obviously if your project includes newer stuff it may cause problems.

MonDieu72 commented 6 years ago

I have the custom list of 12 providers in place. I don't know if it helps but I just tried exporting as an android cordova project and the built the apk with phonegap and the result is exactly the same. Is there another admob plugin available to test with?

hansonbrody commented 6 years ago

If you could let me know how to downgrade to r101 that would be great. I published an app update last night that disabled all of the Ad object events, and now I'm getting reports of even weirder behaviour, like ads popping up at the beginning of layouts then crashing, and some with just white screens when they try to login. I'm going to remove the actual Ad object completely and push a new update, which will hopefully help in the interim.

MonDieu72 commented 6 years ago

Yep seems like a downgrade to r101 would be something I'd like to do as well.

shortercode commented 6 years ago

I would expect the behaviour between using the cordova CLI, Android project and build service all to be roughly the same. The only major build difference is that the build service whitelist limits what versions you can use.

Okay so rough guide to downgrading ( generally NOT recommended, also backup your project ). C3P files are basically zip files, so you can convert them to and from folders. Generally I edit them with 7zip if I need to make a change.

There's a file inside which is the main project file, it's called project.c3proj. It's internal format is JSON, so hopefully you know what that is and how to edit it. If not, don't panic it's fairly easy and there's probably guides online. It should have a field called savedWithRelease this is the main one you need to change, I think you need the value 10100 for r101. Additionally each inbuilt plugin has a version number, which is the release. So they will need changing to r101. As far as I'm aware that's the only bit that needs changing...

If you get something wrong the editor will probably tell you the file is corrupt. Generally a message with more information is printed to the browser console. When zipping up a project make sure to zip the files within the folder, and not the folder, else the zip folder structure will be wrong.

MonDieu72 commented 6 years ago

Thought I'd just let you know that I just tested building with cordova on my local machine (did not change to r101) but as I suspected the result is still the same. I still think it is weird that C3's "ok" buttons do not become invisible but everything else does, very strange.

jagoman85 commented 6 years ago

(This might sound like another issue, but I think it's related)

Hi. I'm experiencing very similar issues since about 2 days ago. All live C3 projects that were working fine, suddenly stopped working on my Samsung S8 (don't have another adroid device to test on). This includes both APK exports and Facebook Instant Games. No changes were made, the games just stopped working, so I'm assuming its to do with an Android or Chrome update. iOS is fine.

Furthermore, some projects can't be remote previewed on my Samsung phone. It's a strange one, but check the attached .cp3 file. This shows up blank on my phone when remote previewing. The reason:

If I change any of those points above, the game works fine on my Samsung. This issue has only arisen in the last few days.

test-blank-screen-2.zip

Oh.... and if you add in the generic C3 OK button as MonDieu72 mentioned, it actually appears! But it's the only thing that appears

C2 projects are unaffected.

MonDieu72 commented 6 years ago

After getting updates for webview and chrome browser a few hours ago, my previously unaffected Samsung Galaxy Tab S is now showing the exact same problems. Soon there will be no samsung units that can play our games made in C3 monetized with the admob plugin.

MonDieu72 commented 6 years ago

Just re-exported the project with no webgl and now on both devices everything works as it is supposed to, but without webgl there is a clear performance hit. Hopefully this info will help with finding a sollution

jagoman85 commented 6 years ago

Thanks MonDieu72. @shortercode , please also check out this forum post for a possible temp solution: https://www.construct.net/wf/forum/construct-3/general-discussion-7/force-webgl1-135173

shortercode commented 6 years ago

Well... this sounds odd. I'm going to see if I can get this to replicate on my S8 and see if it's related to webgl2 like @jagoman85 suggests, hopefully whatever update breaks this will have reached the device by now.

MonDieu72 commented 6 years ago

@jagoman85 I tried the force webgl1 thing and it works fine, have only tested with test ads but I don't see why it would be any different on a "live" game.

shortercode commented 6 years ago

Okay so I can confirm the problem, it's reliably broken on my test device. There's no errors or anything visibly wrong in the code. It just looks like Samsung have introduced a pretty awful GPU driver bug, which is a royal pain.

I could also confirm that forcing it to use webgl 1 corrected the issue, but it's not really a long term solution. Trying to decide on the best route forward for this.

gloater commented 6 years ago

i have a problem white/black screen issues with ads on samsungs...

shortercode commented 6 years ago

Hi everyone, I've got an update for you on this.

So we haven't seen any fixes for this yet from the vendors, and given the somewhat fragmented state of Android graphics drivers it's hard to tell if there's even any progress happening.

You may be aware that it's also started to crop up in a few places outside of mobile advert usage. Given the impact of this as of r111 we have disabled webGL2 in Android for the C2 runtime. It's worth remembering this is a workaround for the problem, but thankfully we're not dependant on webGL2 so the impact should be minimal.

Please try your games in r111 or later and let me know if you are still having an issue.

SnipG commented 6 years ago

Was seeing there is no progress in chromium issues. As i got phone to replicate issue, i used jagoman85 example to make minimum case. As crbug.com/865946 contain to much text, chrome ppl don't look at it anymore. So we could verity issue, and post some minimum example. Anyway, minimum example to replicate: Open r110.2, -> new project -> add sprite and text -> change Loader style percentage text -> remote preview. To replicate it eachtime, you have to close chrome, and remove chrome from memory. Phone used Coolpad E502 - GPU: Mali-T720MP2 Haven't been able to replicate it with phones which use Adreno GPU. Could people test this and report back with phone used + gpu?

shortercode commented 6 years ago

Sorry minor correction here, we disabled webgl2 in r111 not r110. I've updated my message above to reflect that.

@SnipG on my test device ( Samsung S8 - Mali-G71 ) your reproduction produces a blank screen in r110 but works correctly in r111.

SnipG commented 6 years ago

Reported issue to chrome some days ago, today they checked and maybe soon they will fix. Bug report: http://crbug.com/868679

shortercode commented 6 years ago

Good report @SnipG

Looks like they are taking it seriously, hopefully they can identify the offending change soon. Although given that the current pre-release channels supposedly aren't affected we may see it fixed in a couple of months regardless of if they identify it or not.

AshleyScirra commented 6 years ago

Closing as issue appears to be worked around by disabling WebGL 2 on Android and the root cause will be followed up at crbug.com/868679 and crbug.com/865946