diff --git a/media-placeholders/src/main/java/org/wordpress/aztec/placeholders/PlaceholderManager.kt b/media-placeholders/src/main/java/org/wordpress/aztec/placeholders/PlaceholderManager.kt index c4898c100..ff95be985 100644 --- a/media-placeholders/src/main/java/org/wordpress/aztec/placeholders/PlaceholderManager.kt +++ b/media-placeholders/src/main/java/org/wordpress/aztec/placeholders/PlaceholderManager.kt @@ -20,6 +20,7 @@ import kotlinx.coroutines.launch import kotlinx.coroutines.runBlocking import kotlinx.coroutines.sync.Mutex import kotlinx.coroutines.sync.withLock +import kotlinx.coroutines.withContext import org.wordpress.aztec.AztecAttributes import org.wordpress.aztec.AztecContentChangeWatcher import org.wordpress.aztec.AztecText @@ -519,7 +520,7 @@ class PlaceholderManager( } } - private suspend fun clearAllViews() { + private suspend fun clearAllViews() = withContext(Dispatchers.Main){ positionToIdMutex.withLock { for (placeholder in positionToId) { container.findViewWithTag(placeholder.uuid)?.let { @@ -664,7 +665,7 @@ class PlaceholderManager( } override fun beforeHtmlProcessed(source: String): String { - runBlocking { + launch { clearAllViews() } return source diff --git a/settings.gradle b/settings.gradle index ed67ef1fb..811816072 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,6 +1,6 @@ pluginManagement { gradle.ext.kotlinVersion = '1.6.10' - gradle.ext.agpVersion = '8.1.0' + gradle.ext.agpVersion = '8.1.2' gradle.ext.automatticPublishToS3Version = '0.8.0' plugins {