I tried to uninstall dynamic feature module, but the module still exists. No error appears during the uninstallation process. This is my configuration on module :
<dist:module
dist:instant="false"
dist:title="@string/title_komunitas">
<dist:delivery>
<dist:on-demand />
</dist:delivery>
<dist:fusing dist:include="true" />
</dist:module>
The function below is to uninstall the module:
private lateinit var manager: SplitInstallManager
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setTitle(R.string.app_name)
setContentView(R.layout.activity_main)
manager = SplitInstallManagerFactory.create(this)
initializeViews()
}
private fun requestUninstall() {
toastAndLog("Requesting uninstall of all modules." +
"This will happen at some point in the future.")
val installedModules = manager.installedModules.toList()
manager.deferredUninstall(installedModules).addOnSuccessListener {
toastAndLog("Uninstalling $installedModules")
}.addOnFailureListener {
toastAndLog("Failed installation of $installedModules")
}
}
After the uninstall, I check if the module still exists or not using this function:
private fun checkModuleInstalled() {
toastAndLog("Installed module ${manager.installedModules}")
}