4

i have a problem with Camera 2 API in Android. I'm using native android with Android Studio. The camera is okay on TextureView but when i'm trying to take a pict. It doesn't work. I followed teh Kotlin Basic Example in the official github page of Camera 2 API. I saw the Logcat when i opened the Camera Activity :

2018-11-14 09:37:59.963 4009-4009/sayurbox.com.oms E/libc: Access denied finding property "persist.camera.privapp.list"
2018-11-14 09:37:59.965 4009-4958/sayurbox.com.oms E/libc: Access denied finding property "camera.hal1.packagelist"
2018-11-14 09:38:00.166 4009-5002/sayurbox.com.oms E/libc: Access denied finding property "persist.camera.legacy_perf"
2018-11-14 09:38:01.971 4009-4957/sayurbox.com.oms E/RequestQueue: cancel failed: no repeating request exists.
Galih laras prakoso
  • 689
  • 2
  • 7
  • 22
  • Is that on emulator? – Alex Cohn Nov 14 '18 at 06:05
  • can you post the list of permissions you declare on your manifest? it might be that you're just missing one/a few – Nikos Hidalgo Nov 14 '18 at 23:06
  • I have the same problem added all permissions needed in manifest and checked the [permissions at runtime](https://stackoverflow.com/questions/33162152/storage-permission-error-in-marshmallow/41221852#41221852) as well (necessary for API levels 23+) so I guess permissions should not be the issue (at least in my case) – dnhyde Jun 05 '19 at 13:53

1 Answers1

2

I don't know about the exact scenario of yours but in most cases, this happens if not running in the right thread. For example, just running mediaRecorder.start() will cause a similar error but putting media recorder to run on UI thread solves this issue.

runOnUiThread(
        new Runnable() {
        @Override
        public void run() {
            mediaRecorder.start();
        }
});

But as I said this is once scenario, and there could be other scenarios also for the issue.

Hopefully it will help someone.

Abhishek Dwivedi
  • 6,557
  • 3
  • 15
  • 20