vision-camera-face-detector icon indicating copy to clipboard operation
vision-camera-face-detector copied to clipboard

Fixed: Android crash: java.lang.ClassNotFoundException: Didn't find class "com.google.mlkit.vision.common.internal.Detector" on path: DexPathList

Open heedoos opened this issue 2 years ago • 6 comments

React Native: 0.66.5
react-native-vision-camera: 2.15.4
vision-camera-face-detector: 0.1.8
Android API 25
Gradle 7.3

app/build.gradle
buildToolsVersion = "30.0.2"
minSdkVersion = 23
compileSdkVersion = 31
targetSdkVersion = 31
ndkVersion = "21.4.7075529"
androidXAnnotation = "1.2.0"
androidXBrowser = "1.3.0"
kotlin_version = '1.6.0'

app/build.gradle dependencies
classpath("com.android.tools.build:gradle:7.0.0")

I found that android crashes as soon as the app started. I turned on the logcat and found these errors.

java.lang.ClassNotFoundException: Didn't find class "com.google.mlkit.vision.common.internal.Detector" on path: DexPathList java.lang.ClassNotFoundException: com.google.mlkit.vision.face.FaceDetector

Whoever has same issue, you can update "/node_modules/vision-camera-face-detection/android/build.gradle" mlkit face detection version to fix. implementation 'com.google.mlkit:face-detection:16.1.2' => implementation 'com.google.mlkit:face-detection:16.1.5'

@rodgomesc When you get a chance, can you please update this changes?

heedoos avatar Feb 09 '23 14:02 heedoos

I Have the Same issue when multiple face appeare in same time when app crash in android

ajay2966 avatar Feb 17 '23 07:02 ajay2966

@ajay2966 You mean after version upgrade("com.google.mlkit:face-detection" to 16.1.5)?

heedoos avatar Feb 17 '23 13:02 heedoos

@heedoos vision-camera-face-detector version 0.1.8

ajay2966 avatar Feb 20 '23 14:02 ajay2966

Excuse me, any update ?

iita71737 avatar Mar 20 '23 01:03 iita71737

You can patch using this: https://github.com/ds300/patch-package. fix the version and patch it.

heedoos avatar May 17 '23 13:05 heedoos