SumSubstance / idensic-mobile-sdk-sample-android

11 stars 5 forks source link

Verifier rejected class com.google.mlkit.vision.face.FaceDetection #5

Closed KristapsKrumins closed 2 years ago

KristapsKrumins commented 2 years ago

Version 1.19.3

Fatal Exception: java.lang.VerifyError: Verifier rejected class com.google.mlkit.vision.face.FaceDetection: com.google.mlkit.vision.face.FaceDetector com.google.mlkit.vision.face.FaceDetection.getClient() failed to verify: com.google.mlkit.vision.face.FaceDetector com.google.mlkit.vision.face.FaceDetection.getClient(): [0x10]  can't resolve returned type 'Unresolved Reference: com.google.mlkit.vision.face.FaceDetector' or 'Unresolved Reference: com.google.mlkit.vision.face.internal.FaceDetectorImpl'
 com.google.mlkit.vision.face.FaceDetector com.google.mlkit.vision.face.FaceDetection.getClient(com.google.mlkit.vision.face.FaceDetectorOptions) failed to verify: com.google.mlkit.vision.face.FaceDetector com.google.mlkit.vision.face.FaceDetection.getClient(com.google.mlkit.vision.face.FaceDetectorOptions): [0x15]  can't resolve returned type 'Unresolved Reference: com.google.mlkit.vision.face.FaceDetector' or 'Unresolved Reference: com.google.mlkit.vision.face.internal.FaceDetectorImpl' (declaration of 'com.google.mlkit.vision.face.FaceDetection' appears in base.apk!classes6.dex)
       at java.lang.Class.classForName(Class.java)
       at java.lang.Class.forName(Class.java:454)
       at java.lang.Class.forName(Class.java:379)
       at com.sumsub.sns.core.common.DocumentRotationUtils.<clinit>(DocumentRotationUtils.kt:63)
       at com.sumsub.sns.presentation.screen.preview.photo.SNSPreviewPhotoDocumentViewModel$showPhoto$1.invokeSuspend(SNSPreviewPhotoDocumentViewModel.kt:188)
       at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
       at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWith(DispatchedContinuation.kt:367)
       at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable(Cancellable.kt:30)
       at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable$default(Cancellable.kt:25)
       at kotlinx.coroutines.CoroutineStart.invoke(CoroutineStart.kt:110)
       at kotlinx.coroutines.AbstractCoroutine.start(AbstractCoroutine.kt:126)
       at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch(Builders.common.kt:56)
       at kotlinx.coroutines.BuildersKt.launch(:1)
       at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch$default(Builders.common.kt:47)
       at kotlinx.coroutines.BuildersKt.launch$default(:1)
       at com.sumsub.sns.presentation.screen.preview.photo.SNSPreviewPhotoDocumentViewModel.showPhoto(SNSPreviewPhotoDocumentViewModel.kt:171)
       at com.sumsub.sns.presentation.screen.preview.photo.SNSPreviewPhotoDocumentViewModel.onDocumentPicked(SNSPreviewPhotoDocumentViewModel.kt:166)
       at com.sumsub.sns.presentation.screen.preview.photo.identity.SNSPreviewIdentityDocumentViewModel.onDocumentPicked(SNSPreviewIdentityDocumentViewModel.kt:143)
       at com.sumsub.sns.presentation.screen.preview.photo.SNSPreviewPhotoDocumentFragment.onActivityResult(SNSPreviewPhotoDocumentFragment.kt:265)
       at com.sumsub.sns.presentation.screen.preview.photo.identity.SNSPreviewIdentityDocumentFragment.onActivityResult(SNSPreviewIdentityDocumentFragment.kt:37)
       at androidx.fragment.app.FragmentManager$7.onActivityResult(FragmentManager.java:2617)
       at androidx.fragment.app.FragmentManager$7.onActivityResult(FragmentManager.java:2597)
       at androidx.activity.result.ActivityResultRegistry.doDispatch(ActivityResultRegistry.java:392)
       at androidx.activity.result.ActivityResultRegistry.dispatchResult(ActivityResultRegistry.java:351)
       at androidx.activity.ComponentActivity.onActivityResult(ComponentActivity.java:638)
       at androidx.fragment.app.FragmentActivity.onActivityResult(FragmentActivity.java:140)
       at android.app.Activity.dispatchActivityResult(Activity.java:8651)
       at android.app.ActivityThread.deliverResults(ActivityThread.java:5850)
       at android.app.ActivityThread.handleSendResult(ActivityThread.java:5896)
       at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:54)
       at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)
       at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
       at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2434)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loopOnce(Looper.java:226)
       at android.os.Looper.loop(Looper.java:313)
       at android.app.ActivityThread.main(ActivityThread.java:8633)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:567)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1133)
palmut commented 2 years ago

Please, provide additional information about your device? We can't get the error on our devices.

KristapsKrumins commented 2 years ago

Steps to reproduce:

  1. Create new Android project
  2. In module build.gradle add:
    implementation'com.sumsub.sns:idensic-mobile-sdk:1.19.3'
    implementation'com.sumsub.sns:idensic-mobile-sdk-prooface:1.19.3'
    implementation'com.google.mlkit:barcode-scanning:17.0.2'
    implementation'com.veriff:veriff-library:4.5.0'
  3. In MainActivity add
    val modules = listOf(SNSProoface())
        val tokenExpirationHandler = object : TokenExpirationHandler {
            override fun onTokenExpired(): String {
                return ""
            }
        }
        SNSMobileSDK.Builder(this)
            .withAccessToken(
                accessToken = "REPLACE_accessToken",
                onTokenExpiration = tokenExpirationHandler
            )
            .withModules(modules)
            .withLocale(Locale("en"))
            .withDebug(BuildConfig.DEBUG)
            .build()
            .launch()
  4. Run the app
  5. Click continue
palmut commented 2 years ago

Please, add the following dependency implementation 'com.google.mlkit:face-detection:16.1.5'