FaceDetector is not working

I am using ExpoKit 34.

expo sdk version 34
expo-face-detector version ^6.0.1
expo-camera version ^6.0.0

FaceDetector is not working on my ejected project.
It was working well on Expo client.
But as soon as I eject the project in order to use native modules, it stopped working.

platform: iOS

I hope someone’s help.

Hey @topace336,

Can you provide some more information? Simply saying it “is not working” doesn’t give us much context. Is an error being thrown, is it crashing, etc?

Cheers,
Adam

Thank you @adamjnav.

It doesn’t crash after I update the “expo-face-detector” module from 6.0.0 to 6.0.1.
But now the problem is that the face detector is not working.
It doesn’t detect any faces at all.
It doesn’t trigger onFaceDetected event.

But before I eject the project, it worked well.
I could see the rectangle around my face in real-time.

Hi @adamjnav. See also:

It looks like @wkozyra’s comment on the above issue is the answer:

add field ios.googleServicesFile to app.json (this requires latest cli)

@quanhv94, in case you are still around, I think this will also solve your problem.

@wodin
Could you tell me in more details?
I am not sure what to do.

Make sure you have the latest version of expo-cli. Then make your app.json look something like this:

{
  "expo": {
...
    "ios": {
      googleServicesFile: "./GoogleService-Info.plist"
    }
  }
}

I have not worked with the FaceDetector or Firebase before, so I’m not sure what’s supposed to be in google-services.json, but maybe the Expo Firebase docs and the following will help:

https://support.google.com/firebase/answer/7015592?hl=en

EDIT: Changed the filename in the app.json example.

Thank you @wodin
iOS doesn’t support json service file
It provides plist file.
@adamjnav
Could you help me with this?

In that case, try getting hold of the plist file. And then put the path to that file in your app.json file.

Still doesn’t work. I added the line to my app.json and added the path to my GoogleService-Info.plist but no luck. I get the following warning:

@wodin
Does it work for you?

hmmm… it looks like there was code on an earlier version of the sdk-34 branch to call [FIRApp configure] but it was wrapped in a check for host.exp.Exponent, so I think it would only work in a managed app. But there’s a later change that moves the check into a new EXFaceDetectorAppDelegate.m file and removes the host.exp.Exponent restriction.

There’s also a commit to publish expo-face-detector@6.0.1.

I’m still a little unclear on how some of the versioning works and how all the different pieces of Expo fit together, so I’m not sure what the solution is, but I suspect it involves upgrading to expo-face-detector@6.0.1 and maybe making sure you have the latest expo-cli and expo as well.

@topace336, no, as mentioned in a previous comment I have not done this. Perhaps my comment was a little ambiguous. I have not done this before and I have not done it now either. I have not yet needed to use the FaceDetector. I am just trying to point out possible solutions based on answers I have seen elsewhere :slight_smile: I hope it helps.

@wodin I already have expo-face-detector@6.0.1 . installed which is why I find this error to be quite odd

1 Like

@wodin I am already using expo-face-detector@6.0.1.
The problem is that it doesn’t detect any faces on camera.

Hi @sjchmiela , do you have an idea on how to solve this problem?