应用程序具有ML Kit功能(翻译)。我试图通过引入一个动态模块特性,即按需加载来减小应用程序的大小。
Following this guide将'com.google.mlkit:playstore-dynamic-feature-support:16.0.0-beta1‘添加到基本apk的build.gradle中
Com.google.mlkit:翻译:16.1.2功能模块build.gradle,
一切都编译并尝试在模拟器上运行,但不幸的是,在应用程序开始时崩溃,并显示日志
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哪种方式没有意义。因为我已经添加了playstore-dynamic-feature-support。
发布于 2021-06-30 06:03:11
要设置动态模块,您需要将mlkit转换依赖项从基础应用程序的gradle文件移动到动态模块的gradle构建文件。您还需要将所有相关用法移动到动态模块。因此,当应用程序启动时,它不会查找任何mlkit转换依赖项。有关步骤到步骤的设置指南,请参阅play store on demand delivery guide。
https://stackoverflow.com/questions/68153515
复制相似问题