I copy part of the firebase-mlkit
sample code only for Image labeling. When I run on my Nokia 6.1
and got the following error message:-
type=1400 audit(0.0:4015): avc: denied { read } for name="u:object_r:vendor_camera_prop:s0" dev="tmpfs" ino=17821 scontext=u:r:untrusted_app:s0:c7,c256,c512,c768 tcontext=u:object_r:vendor_camera_prop:s0 tclass=file permissive=0
E/libc: Access denied finding property "vendor.camera.aux.packagelist
I put the following permission in the AndroidManifest.xml.
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
I can run the sample firebase-mlkit
on the Nokia 6.1 without any problem. Any idea?
I am not sure about the root cause of this issue but I was able to solve this issue by delaying to start camera preview in my App.
@Override
protected void onResume() {
super.onResume();
final Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
camera.startPreview();
}
}, 300);
}
Don't forget to stop preview and release camera onPause event of activity.