'error: Program type already present: android.support.v4.app.INotificationSideChannel when add com.google.android.gms

I know it could look like This Question but I could not fix it with the solution proposed and I could not comment on it too. The Error is : After add

implementation 'com.google.android.gms:play-services-mlkit-text-recognition:18.0.0'

I face this error.

Task :app:mergeDebugAssets AGPBI: {"kind":"error","text":"Program type already present: android.support.v4.app.INotificationSideChannel","sources":[{}],"tool":"D8"} Error: Program type already present: android.support.v4.app.INotificationSideChannel

Task :app:mergeExtDexDebug FAILED java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes. Program type already present: android.support.v4.app.INotificationSideChannel at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source