Android Studio show me the Error load: id=gralloc != hmi->id=gralloc

Viewed 4941

My IDE shows me the error even is empty project. As you can see I create the new project with empty activity. App is launched in mobile successfully and work fine. but logcat isn't working properly or any thing else I'm stuck help me out. And when I connect my mobile even I didn't build the project logcat is full of instruction/logs.

enter image description here

enter image description here

4 Answers

UPDATE:

First, gralloc stands for the low-level graphics buffer allocator.

The gralloc is part of the HAL (Hardware Abstraction Layer) which means that the implementation is platform-specific. You can find the interface definitions in hardware/libhardware/include/hardware/gralloc.h. As expected from a HAL component, the interface is divided into a module interface (gralloc_module_t) and a device interface (alloc_device_t).

The error is very low level and related with OpenGLRenderer. Your device is trying to open some 64-bit library files, but if fails. Then the error occurs.

I did very deep search about this but nothing useful came up.

Try running apps on another devices and see the error occurs again.

Continue developing if the error is not causing crash or other important issue. If you find a solution, you will try again.

in my case, I tried to use Application class static context for calling new Activity and I changed it to local static Activity and problem solved. Notice that this problem doesn't happen in all devices it just occur in some cases.

private  static MainActivity u_static;
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_users);
    u_static = this;
}
  public  static void new(int id, String name){

    Intent i  = new Intent(u_static, NewActivity.class);
    u_static.startActivity(i);

}

And something I notice that in some devices when an application stops working instead of showing error, this error happens. Trace and debug your codes.

About the crazy E/HAL: load: id=gralloc != hmi->id=gralloc Reason for error: Generally, it is caused by the fact that the control object is not fetched, the click event of the control is executed, and the null value is related to the initialization control. As

private Button bt;  
bt.setOnclickListener(new OnClickLisenter(){....});

Is there a problem? Yes!

  1. xml layout control

    Check if the findViewById() is missing in the java code!     The above leaked bt = (Button) findViewById(R.id...);

  2. java dynamic new control / custom control error

         Check if you forgot to create the object!      The above leaked bt = new Button();

So the correct way to change the above code is:

private Button bt;
bt=(Button)findViewById(R.id...); 

I encountered this issue while using runnable and passing an unassigned view. This is caused by an empty view object where findViewById returns a null value. Instead of passing the view object passing the value the view holds resolved the issue.

Related