How to fix Error: HTML5 browser with WebGL […] support required, when running krpano via phonegap in Android Studio?

  • I want to run Krpano code as a standalone app. After some tweaks in Xcode, it works
    great on iOS (including VR mode), but on Android, I have no idea how to get past this error.


    I KNOW this is not pure KRPano question, as the solution lies outside krpano code itself, but still, I know people have been doing it for years, I've read posts about is on this forum too years ago.

    I've done an extensive search, and no answers are safisfactory. I've been pursuing a couple of options so far:


    •Adding this code (to somewhere) in webview classes or android sdk files:


    $ publicabstractvoid setAllowContentAccess(boolean allow);
    $ publicabstractvoid setAllowFileAccessFromFileURLs (boolean allow);
    $ publicabstractvoid setAllowUniversalAccessFromFileURLs (boolean allow);
    $ publicabstractvoid setAllowFileAccess(boolean allow);


    Source: https://developer.android.com/reference/andr…ebSettings.html


    •Adding this code (to somewhere?) in the "activity" (i presume a Cordova file, class..?):


    $ myWebView.getSettings().setAllowFileAccess(true);
    $ myWebView.getSettings().setAllowContentAccess(true);
    $ myWebView.getSettings().setAllowFileAccessFromFileURLs(true);
    $ myWebView.getSettings().setAllowUniversalAccessFromFileURLs(true);


    Source: Problems using krpano locally in Android and iOS


    •Somehow using CrossWalk (though latest update was in 2017-discontinued)


    Basically, the aim I presume is to somehow enable WebGL in Android's
    WebView, either by making changes in Android Studio, or by some command
    in Cordova/PhoneGap.
    I know some people managed to solve this, just how, remains unclear.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!