I have used the gms.vision api for barcode scanning in my application. I upgraded my studio, gradle to create the aab file. I started to face the crash issue only in release mode with the below log:
java.lang.IllegalArgumentException: Unexpected number of IObjectWrapper declared fields: 0
at vyc.a(:com.google.android.gms@19275046@19.2.75 (120400-269183835):9)
at com.google.android.gms.vision.client.DynamiteNativeBarcodeDetectorCreator.newBarcodeDetector(:com.google.android.gms@19275046@19.2.75 (120400-269183835):1)
at awhf.a(:com.google.android.gms@19275046@19.2.75 (120400-269183835):3)
at cqq.onTransact(:com.google.android.gms@19275046@19.2.75 (120400-269183835):3)
at android.os.Binder.transact(Binder.java:914)
at com.google.android.gms.vision.barcode.internal.client.c$a$a.a(Unknown Source:40)
at com.google.android.gms.vision.barcode.internal.client.d$a.b(Unknown Source:14)
at com.google.android.gms.vision.barcode.internal.client.d$a.a(Unknown Source:13)
at com.google.android.gms.vision.barcode.internal.client.d.b(Unknown Source:11)
at com.google.android.gms.vision.barcode.internal.client.d.<init>(Unknown Source:17)
at com.google.android.gms.vision.barcode.a$b.a(Unknown Source:6)
I have added the vision library under dependency as follows:
implementation "com.google.android.gms:play-services-vision:"8.3.0"
Without upgrading the vision api version, is there a way to fix this crash issue?
Adding the following line in gradle.properties file has resolved the crash issue:
android.enableR8=false