10

I'm working on a simple counter project, you press a button and the number displayed either gets +1 or -1. I'm getting a run time error indicating:

E/libc: Access denied finding property "vendor.debug.egl.profiler"

Where does this error come from? And what can be done to fix it?

package com.example.mtglifecounter;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity {

Button counter1Up, counter1Down, counter2Up, counter2Down;
TextView lifeCount1, lifeCount2;


int life1 = 20;
int life2 = 20;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    setUI();

    counter1Up.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            life1 = life1+ 1;
            lifeCount1.setText(life1);
        }
    });

    counter1Down.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            life1 = life1 -1;
            lifeCount1.setText(life1);
        }
    });

    counter2Up.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            life2 = life2 + 1;
            lifeCount2.setText(life2);
        }
    });

    counter2Down.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            life2 = life2 - 1;
            lifeCount2.setText(life2);
        }
    });
}

public void setUI(){
    counter1Up = findViewById(R.id.counter1UpBTN);
    counter1Down = findViewById(R.id.counter1DownBTN);
    counter2Up = findViewById(R.id.counter2UpBTN);
    counter2Down = findViewById(R.id.counter2DownBTN);

    lifeCount1 = findViewById(R.id.counter1TV);
    lifeCount2 = findViewById(R.id.counter2TV);

    lifeCount1.setText("20");
    lifeCount2.setText("20");
}
}

and this is all that comes up in Logcat:

2019-01-21 21:12:49.524 22001-22049/com.example.mtglifecounter E/libc: Access denied finding property "vendor.debug.egl.profiler"
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Filipe
  • 109
  • 1
  • 6

1 Answers1

0

Where does this error come from?

Android SELinux (rules/config, which done by OEM)

And what can be done to fix it? refer:

need to use audit2allow and other tools, maybe finnaly can fix it.

More detailed explanation can refer another post

crifan
  • 12,947
  • 1
  • 71
  • 56