Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Mik-el opened this issue Jul 29, 2022 · 2 comments
Open

Comments

@Mik-el
Copy link

Mik-el commented Jul 29, 2022

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
Copy link
Author

Mik-el commented Aug 3, 2022

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

@Luca96
Copy link
Owner

Luca96 commented Aug 4, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants