WebGL issues on Android

Thread is closed for posting
2 posts, 0 answers
  1. Zinc
    Zinc avatar
    23 posts
    Member since:
    Aug 2013

    Posted 04 Nov 2015 Link to this post

    I have some code that uses WebGL (using the three.js library). Everything works fine in iOS but it won't work on Android. I've only tested it on a Samsung Galaxy S5 (Android 5.0) and a Samsung Galaxy S3 (Android 4.4.4).  The code isn't complicated, mostly based on Google demo code.

    The error I get is:

    [chromium] "Error creating WebGL context." at file: js/three.js (25050)
    [chromium] "Uncaught TypeError: Cannot read property 'getExtension' of null" at file: js/three.js (25054)

    I've turned on Android Hardware Acceleration (and tried with it off). I also tried setting Cordova 4.0.0 and 3.7.0 setting in AppBuilder. 

    I've tried going to the Chrome app and WebGL is enabled - I looked at chrome://flags and chrome://gpu and can't see any problems. I did this on both the Chrome app (Chrome version 46.0.2490.76) and the default browser app (Chrome 34.0.1847.76). I also tried changing Cordova's WebView to Crosswalk.

    I've played with just the web browser (Chrome) and some WebGL demo pages, some work, some don't. 

    I also tried the same code on a web page running on the Chrome browser and it works. So I'm sure the code is right (and the fact that everything works on iOS), and that the phone does support WebGL because it works in a browser.

    So what I really need is a way to get Cordova (using AppBuilder) to use WebGL on Android. Any ideas? 

  2. Tina Stancheva
    Tina Stancheva avatar
    3299 posts

    Posted 09 Nov 2015 Link to this post


    We haven't had similar issues reported on our side and I am not familiar with the Android limitations with the three.js library. I looked around the net for similar reports and I noticed that there are a couple but I wasn't able to find a specific solution.

    As far as a webview goes, Crosswalk supports WebGL while not all WebView versions do. With that in mind, I am not sure why even changing the webview doesn't work on your side. It might be best to post these errors in the three.js repository issues section so that their community can help you find a solution.

    Alternatively, if you can provide me with a sample project or a link to the example you're trying to run, i can try to investigate this behavior further on our side and see if we can find a solution. Still, please keep in mind that as this behavior doesn't seem to be specifically related to the AppBuilder environment, I cannot tell for sure to what extend I will be able to assist you find a solution with the three.js library implementation.

    Tina Stancheva

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

Back to Top