Black screen with Admob on android (apk) [SOLVED]

  • (The probleme is now solved. If you want to get the solution, go to the my fourth reply)

    Hello everyone,

    I'm currently creating a mobile game with ads by using MobileAdvert (Admob). When I want to show a rewarded video it turn to a black screen and then, show the ad perfectly. But after I see the video, the game still to show a black screen until I restart the game.

    My theory is when the game start to use MobileAvdert, graphics aren't accepted and then turn black. Is it possible to disabled MobileAdvert after showing an Ad or there is an other issue to solve that?

    Thanks for reading me

  • Are you testing on a Samsung device?

    I seems samsung has done something that broke WegGl2 on their devices.

    You can disable WebGl in your project or try this(worked for me): construct.net/forum/construct-3/general-discussion-7/force-webgl1-135173

  • Thank you for your answer. But I tested my game on Asus devices. I saw the discussion about WebGL1 but I don't know how to change the runtime in construct 3 to force WebGL1. Where is it?

  • Consider debugging your APK before jumping to conclusion.

    As for the "fix" forcing webGL1, it is in the exported file "c2runtime.js" that you must not minify in order to modify it after export.

  • Thank you for your answer. I finally found the file "c2runtime.js", changed the line to fix webGL 1, exported with Android studio to generate a signed apk file. But nothing change... When the ad is loading, black screen but I can hear the sounds of the game.

  • I have the same problem with construct2. The app with ads worked fine until last week. Now it shows a black screen after preloading the ads, sound is still playing. Although the game functions are working, but nothing is visible.

  • Sonste

    Hello,

    I finally found a solution by checking this forum:

    https://www.construct.net/fr/forum/construct-3/general-discussion-7/force-webgl1-135173

    But let's me recap the process:

    1: Export your project NOT minified with cordova to an Android studio project

    2: In your folder, follow this path app\src\main\assets\www

    3: Open the file C2runtime.js with Notepad

    4: In Notepad, go to Edit, Search

    5: Search this line:

    this.gl.getParameter(this.gl.VERSION).indexOf("WebGL 2") === 0

    Replace by this:

    this.gl.getParameter(this.gl.VERSION).indexOf("WebGL") === 0

    6: By the same process, replace this line:

    this.canvas.getContext("webgl2", attribs)

    by this:

    this.canvas.getContext("webgl", attribs)

    7: Then, import your project in Android Studio, build it and generate a signed apk with your keystore

    Sadly, according to the Scirra's team, this bug came by Google Chrome who blacklisted WebGL2 for some devices. I wrote a message to them to find a solution by allow all the devices to get WebGL2. For now, we have to agree to repeat this procedure for all our mobile games using Admob...

    Anyway, thanks all lot for the community, you're awesome

  • Hello samsuffi,

    thank you for posting your solution. I tried your way with c2, cordova export and phone gap, w/ and w/o minifying:

    - now the game loads with preloaded ads and ads are showing

    - but many sprites are still black, so the game is still not playable

    Hopefully there will be found a solution rapidly!

  • I have exactly same situation.

    Black screen or White screen or Blue screen [depend on BG color] ... music is playing normaly... you can also press on object that you don't see any of them... but on a next layouts there is a same effect... only Black/white/blue screen [depend on BG color]

    Is it because of:

    1. pugins improvment ?

    2. Some runtime changes.... ???

    3. Backend compilcation on C3 server changes....??? [A few days ago all worked fine... now NOT]

    I can add that on devices with Android 5.0 < 6 all works fine

    When i run APK on devices with Android 7,8 this problem is still occuring.

    HELP US!! C3 Dev. TEAM

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • All becasue of WebGL....

    When i turned OFF WebGL all works super fine... EVEN i have a better performance!!!

    PLUS.... NO mysterious artefacts!!!!

    NO MORE WebGL!!! it is shityyy library... time to remove effect from project.

    Performance is more important then shit effects...

  • Hello HayateX,

    I'm so sorry that my solution don't works for you... And it reveals a very bad new for all the mobile's developpers. I hope that Google chrome solves this problem fast but until now, no answer...

    However, my solution consisted in forcing WeGL2 to change to WebGL1. If it don't works for you, we can suppose now that some effects in Construct 2/3 aren't supported by mobiles at all. But which ones?

    Complicated... Is there an other solution to make effects in construct without WebGL and plugins?

  • The performance boost is not the result of turning off WebGL, it is the result of removing your effects.

    If you will use WebGL without effects it will be even more improved.

  • Ok, ok, But... how you can explain "random mysterious artefacts" when i have a WebGL ON... ???

    Device Honor 8 with:

    Chipset HiSilicon Kirin 950

    CPU Octa-core (4x2.3 GHz Cortex-A72 & 4x1.8 GHz Cortex A53)

    GPU Mali-T880 MP4

    Similar on Samsung S8:

    Chipset Exynos 8895 Octa - EMEA

    Qualcomm MSM8998 Snapdragon 835 - USA & China

    CPU Octa-core (4x2.3 GHz Mongoose M2 & 4x1.7 GHz Cortex-A53) - EMEA

    Octa-core (4x2.35 GHz Kryo & 4x1.9 GHz Kryo) - USA & China

    GPU Mali-G71 MP20 - EMEA

    Adreno 540 - USA & China

    On samsung i observed different artefacts....[but for end-user it is unacceptable ! ]

    When i turned OFF WebGL...

    ALL IS FINE!!! ZERO random mysterious artefacts.

    Test Your APK on real devices not in DevKit on your PC this is my advice for all of us my dev. friends.

    I will pray for a new WebGL library...

  • I just commented your "performance boost", since that was incorrect.

    We have like ten threads saying there is an issue with android devices and webgl, so we all know it. In fact the issue seems to be with Webgl2 not webgl, but if you turn off webgl totally it will also work of course (I would though not recommend it, since canvas sucks in comparison)

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