Skip to content

[Bug report] ML Kit crash with dynamic feature module (conditional delivery) #457

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
SaraTalaat91 opened this issue Mar 6, 2022 · 3 comments
Assignees

Comments

@SaraTalaat91
Copy link

I'm working on a feature that utilizes ML Kit Translation, and since this feature is only available for a specific country, I've moved the implementation for this feature along with ML Kit dependency to a dynamic feature module and set the delivery in the manifest to be conditional according to the user's country.

I've followed this guide to move the ML Kit by adding support dependency in the base app build.gradle file:

dependencies {
implementation 'com.google.mlkit:playstore-dynamic-feature-support:16.0.0-beta2'
}

After doing so, the application started to crash on app open if the condition is met and the feature module is included at install time, otherwise everything works fine.

Here's the log for the crash:

   java.lang.RuntimeException: Unable to get provider com.google.mlkit.common.internal.MlKitInitProvider: com.google.firebase.components.MissingDependencyException: Unsatisfied dependency for component Component<[class com.google.android.gms.internal.mlkit_translate.zzxa]>{0, type=0, deps=[Dependency{anInterface=class com.google.mlkit.common.sdkinternal.SharedPrefManager, type=required, injection=direct}, Dependency{anInterface=class com.google.android.gms.internal.mlkit_translate.zzwx, type=required, injection=direct}]}: class com.google.mlkit.common.sdkinternal.SharedPrefManager

 Caused by: com.google.firebase.components.MissingDependencyException: Unsatisfied dependency for component Component<[class com.google.android.gms.internal.mlkit_translate.zzxa]>{0, type=0, deps=[Dependency{anInterface=class com.google.mlkit.common.sdkinternal.SharedPrefManager, type=required, injection=direct}, Dependency{anInterface=class com.google.android.gms.internal.mlkit_translate.zzwx, type=required, injection=direct}]}: class com.google.mlkit.common.sdkinternal.SharedPrefManager

SDK Info:
com.google.mlkit:translate:16.1.2

@SaraTalaat91 SaraTalaat91 changed the title [Bug report] ML Kit with dynamic feature module (conditional delivery) [Bug report] ML Kit crash with dynamic feature module (conditional delivery) Mar 6, 2022
@zhouyiself
Copy link
Collaborator

playstore-dynamic-feature-support lib is for on-demand delivery and may not needed for conditional delivery.
What if you remove this lib dependency and just use ML Kit in the regular way in your dynamic feature module?

@SaraTalaat91
Copy link
Author

@zhouyiself Though we are using conditional delivery to deliver this feature according to user's country, we also need to provide on demand delivery if the user changes country from within application. This is why we need to deliver this feature either conditional or on demand. It'd be really nice if the support library was flexible enough to be used for this case.

@savvaspit
Copy link

Any update on this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants