1

I have just created an API 23 emulator on my machine:

  • HAXM: v1.4 with 1GB allocated RAM
  • AVD Base: Nexus 4
  • RAM: 768MB, and 896MB in a second try
  • Heap: 64 MB
  • GPU acceleration: no

I tried it successfully with a few apps of my own. But each time I try an application that uses a WebView as a UI, the app crashes that way:

enter image description here

The three first line of this logcat are the only pertaining to my app (highlighted in blue). All other lines do not mention my application package's name in the 'Application' column of LogCat, but one does in the middle of the message (circled in blue).

I can load the HTML code into the WebView. The crash occurs at setContentView(theWebView) time:

public class MyActivity extends Activity { 
    private WebView mWebview = null; 

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState); 

        mWebview = new WebView(this);
        mWebview.loadDataWithBaseURL("file:///android_asset/", HTML_CODE, "text/html", "UTF-8", null);

        setContentView(mWebview); // THIS IS WHERE THE CRASH OCCURS
    }

    [...]

Using or not using runOnUiThread() to run mWebview.loadDataWithBaseURL() produces exactly the same result, which is expected as onCreate() is actually on the UI thread.

The html code I am using does not change anything. In the case above, the HTML_CODE variable contains this:

<html>
    <head></head>
    <body>
        <h1>Hello</h1>
        <p>Hello world!</p>
    </body>
</html>

The app runs perfectly, even with a more advanced HTML+CSS+JS+JS<->Java binding code on all the API 17 and 19 devices and emulators I tried. This is where I'm puzzled. I didn't have a chance to try with an actual Android 6.0 (API 23) device though.

EDIT

I have just :

  • migrated from Eclipse to Android Studio
  • upgraded HAXM to v1.5
  • upgraded my SDK Tools (24.4.1) and my platform (23.0.1)

The problem still occurs but the log is different, and a bit clearer. There is a ClassNotFoundException I cannot explain:

10-28 20:26:05.102 2168-2168/com.example.myapp W/System: ClassLoader referenced unknown path: /data/app/com.example.myapp-1/lib/x86
10-28 20:26:08.583 2168-2168/com.example.myapp E/DataReductionProxySettingListener: No DRP key due to exception:java.lang.ClassNotFoundException: com.android.webview.chromium.Drp
10-28 20:26:09.393 2168-2213/com.example.myapp W/chromium: [WARNING:data_reduction_proxy_config.cc(423)] SPDY proxy OFF at startup
10-28 20:26:12.521 2168-2286/com.example.myapp A/chromium: [FATAL:gl_surface_android.cc(58)] Check failed: kGLImplementationNone != GetGLImplementation() (0 vs. 0)
10-28 20:26:12.521 2168-2286/com.example.myapp A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 2286 (GpuThread)

Any idea? (I'm investigating further so I will update this post should I find anything relevant)

5
  • 1
    Unless you have written your own NDK code, you are running into a bug with the WebView. There is nothing much you can do about that, other than to experiment with your Web content to see if you can isolate what you are doing that is triggering the bug. Sep 25, 2015 at 18:13
  • @CommonsWare Thanks for that CommonsWare. I'll investigate further and update this post when I'll have something relevant.
    – Shlublu
    Sep 25, 2015 at 18:14
  • 1
    I believe this is related to code.google.com/p/android/issues/detail?id=189040 Dec 29, 2015 at 22:51
  • @cryptojuice Yes, certainly. I was hopeful as the SDK distribution was updated, by the problem still occurs. DataReductionProxySettingListener: No DRP key due to exception:java.lang.ClassNotFoundException: com.android.webview.chromium.Drp (which is the same as before)
    – Shlublu
    Jan 19, 2016 at 10:27
  • @cryptojuice As the only thing we can do is to wait for this to be fixed, I answerd my own question as you can see below. The actual information comes from you though, so feel free to write an actual answer with it. I'll accept it.
    – Shlublu
    Feb 12, 2016 at 10:58

1 Answer 1

3

This behaviour was not caused by any erroneous setting of the AVD or any missing prerequisite (harware, etc...).

As cryptojuice mentioned in comments this was caused by an OpenGL ES prerequisite issue on emulator side:

#8 ...@chromium.org

Unfortunately OpenGL ES 2.0 support has been mandatory for devices since at least Android 4.0, so we haven't ever explicitly supported GLES 1.x at all and it was only working before by accident :/

It seems a bit problematic that the emulator (without host GPU emulation) doesn't meet the minimum requirements for Android devices.

We might be able to work around this for the emulator at a significant performance cost; we're talking to the emulator team about what the best thing to do here is.

Now this is fixed (SDK tools 25.1 RC1 / platform 23 rev 3), even though this doesn't appear on the ticket linked above.

1
  • I am running my emulator inside VMware so I have GPU emulation off (the AVD won't start if I turn it on). I have SDK platform 23 rev 3 and I still get the "check failed: kGLImplementationNon != GetGLImplementation() (0 vs. 0)" error and the browser won't start. If I have SDK platform 23 rev 3 is there anything else I need to do to get it to work? Dec 11, 2017 at 22:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.