Abdul Mateen

Abdul Mateen

_kfun:androidx.lifecycle.viewmodel.compose#androidx_lifecycle_viewmodel_compose_LocalViewModelStoreOwner$stableprop_getter$artificial(){}kotlin.Int

I faced this issue while trying to run Kotlin Multiplatform on iOS simulator, here is the error Link CMPSkeleton.debug.dylib (arm64)Undefined symbol: _kfun:androidx.lifecycle.viewmodel.compose#androidx_lifecycle_viewmodel_compose_LocalViewModelStoreOwner$stableprop_getter$artificial(){}kotlin.IntLinker command failed with exit code 1 (use -v to see invocation) To resolve this issue, I just added…

Integrate Ktor in Kotlin Multiplatform in a structured way

First of all declare internet permission in AndroidManifest.xml const val BASE_URL = “”fun constructUrl(url: String): String { return when { url.contains(BASE_URL) -> url url.startsWith(“/”) -> BASE_URL + url.drop(1) else -> BASE_URL + url }} Create an object file named HttpClientFactory.kt…

KMP/CMP libraries which are commonly added in gradle files

[versions]splash-screen = “1.0.1”koin = “4.0.0”ktor = “3.0.2”coroutinesVersion = “1.10.1”koinComposeMultiplatform = “4.0.0”coil3 = “3.0.4”uiTooling = “1.8.1”assertk = “0.28.1”mockk = “1.13.5”compose-navigation = “2.9.0-beta01” [libraries]core-splashscreen = { group = “androidx.core”, name = “core-splashscreen”, version.ref = “splash-screen” }lifecycle-viewmodel-compose = { module = “org.jetbrains.androidx.lifecycle:lifecycle-viewmodel-compose”, version.ref…

Avoid wasting API/Local database calls in Android using Debounce in searchbar.

Utilize in Composable. class MainActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) enableEdgeToEdge() setContent { AndroidPlaygroundAppTheme { val viewModel = viewModel<MainViewModel>() MainCompose( searchQuery = viewModel.searchQueryState.collectAsStateWithLifecycle().value, onQueryChange = { viewModel.updateSearchQuery(it) }, searchResultList = viewModel.searchResultList.collectAsStateWithLifecycle().value ) } } }