Skip to content Skip to sidebar Skip to footer

Facedetectorhandle﹕ Native Face Detector Not Yet Available. Reverting To No-op Detection

I'm trying to incorporate the Google Play Services 7.8 Face API in my app, but every time I try to detect faces it gives me the error: FaceDetectorHandle﹕ Native face detector n

Solution 1:

The first time that face detection functionality is run on a device, it is necessary to download a face detection library to the device. The "Native face detector not yet available." message indicates that the library has not yet been downloaded.

It's recommended that the mobile vision dependencies are added to the AndroidManifest.xml. This will proactively request the library download when the app is installed. See this note in the docs:

Add the Vision Dependency to your Android Manifest

Adding the vision functionality dependency to your project's AndroidManifest.xml will indicate to the installer that it should download the dependency on app install time. Although this is not strictly required, it can make the user experience better when initially running your app. For example, adding the following to AndroidManifest.xml (in the application section) will indicate that both the barcode and face detection dependencies should be downloaded at app install time:

<meta-data android:name="com.google.android.gms.vision.DEPENDENCIES" android:value="barcode,face">

Valid vision dependency values are: barcode or face

However, even if this is supplied, in some cases the dependencies required to run the detectors may be downloaded on demand when your app is run for the first time rather than at install time. See isOperational() and detectorIsOperational() for more information on checking the dependency download status in your app.

As indicated above, your app can check for this with the isOperational() method:

https://developers.google.com/android/reference/com/google/android/gms/vision/face/FaceDetector.html#isOperational()

The detector will try to download the libraries while your app is running, and will automatically become operational once the libraries have been obtained.

But in some cases the download might not succeed (e.g., if the device does not have sufficient free storage space, or if the device isn't connected to the network). The first thing to try would be freeing up more storage space.

Calling release()

The following warning from the log indicates a different issue:

W/FaceDetector(25536): FaceDetector was not released with FaceDetector.release()

Your app should call the release() method on the detector (or camera source) when it no longer needs it. This will free up resources. Although this isn't related to the download issue, it is good to do in general. For example, if the detector was created in an activity, it's good to release that resource in onDestroy():

protected void onDestroy() {
    super.onDestroy();
    mCameraSource.release();
}

Solution 2:

A service required by Mobile Vision is now disabled due to an issue with that service. This will prevent users who have not already used face or barcode detection from using those features. We do not recommend adding new Mobile Vision features to your app until this issue is fixed.

Announcement

There is a service that downloads files required by Mobile Vision to run but is now disabled due to a serious bug discovered late in development. This will prevent users who have not already used Face or Barcode detection from using Face or Barcode scanning. We offer the following advice to Google Play Services developers:

Do not add new Mobile Vision features until this issue is fixed. For apps that already use Mobile Vision functions, call FaceDetector.isOperational() or BarcodeDetector.isOperational() to check for detector readiness and degrade feature operation accordingly. We are working to correct the problem as soon as possible. We expect it will take several weeks to test it thoroughly.

Source: https://developers.google.com/vision/announcement

Post a Comment for "Facedetectorhandle﹕ Native Face Detector Not Yet Available. Reverting To No-op Detection"