android-face-landmarks icon indicating copy to clipboard operation
android-face-landmarks copied to clipboard

Some compiling errors: "unresolved reference" and "await suspension"

Open Mik-el opened this issue 3 years ago • 2 comments

Hi, I correctly replaced the 2 paths in the "CMakeLists.txt" but the build fails for these errors:

  1. Class CameraActivity.kt, line 280. "The 'await' suspension point is inside a critical section"
  2. Class CameraActivity.kt, line 218. "Unresolved reference: maxBy" and "Unresolved reference: it"
  3. Class CameraUtil.kt, line 66. "Unresolved reference: maxBy" and "Unresolved reference: it"

I'm new to Kotlin syntax, how can I solve them?

Thanks in advance

Mik-el avatar Jul 29 '22 14:07 Mik-el

Ok, I solved the 2nd and 3rd error. Initially I replaced the "maxBy" method with "maxByOrNull". But then I deleted the Android studio project, I reimported it and the maxBy error was solved.

The first error is still here... I coded a workaround (with the delay() method) but when the app "loses" the first detected face and detects the second one, it crashes

Mik-el avatar Aug 03 '22 14:08 Mik-el

Hi @Mik-el, sorry for the late response but I'm a bit busy..

Anyway, good that you managed to solve issue 2 and 3. Following this answer, you can try to use a Mutex instead of the ReentrantLock, just change this line.

It's been a few years that I'm not anymore into Kotlin/Android development, so I may be not able to fully help you... Let me know how it goes

Luca96 avatar Aug 04 '22 10:08 Luca96