java.lang.NoClassDefFoundError Google Vision API安卓版。

问题描述 投票:0回答:1
2020-05-12 22:21:32.300 27492-27492/com.example.smith.app E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.smith.app, PID: 27492
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/vision/face/internal/client/zzc;
    at com.google.android.gms.vision.face.FaceDetector$Builder.build(Unknown Source)
    at com.example.smith.swipe.SelectProfilePic$3.onClick(SelectProfilePic.java:123)

我想检测上传的图片中是否有脸。

   FaceDetector faceDetector = new FaceDetector.Builder(getApplicationContext())
                    .setTrackingEnabled(false)
                    .setLandmarkType(FaceDetector.ALL_LANDMARKS)
                    .setMode(FaceDetector.FAST_MODE)
                    .build();

当我在一个新的项目上试了一下,它完美无瑕。

我在两个项目上使用的版本。

implementation 'com.google.android.gms:play-services-vision:11.8.0'
java android google-vision
1个回答
0
投票

把这个放在Manifest中 <application> 标签。

<uses-library android:name="org.apache.http.legacy" android:required="false"/>

© www.soinside.com 2019 - 2024. All rights reserved.