Close Menu
geekfence.comgeekfence.com
    What's Hot

    Framework’s Data Breach Revealed Customer Data: Here’s What to Know

    August 9, 2026

    Eutelsat hails 5G NTN to take on ‘American giants’

    August 9, 2026

    The Skills Modern Data Professionals Need in 2026

    August 9, 2026
    Facebook X (Twitter) Instagram
    • About Us
    • Contact Us
    Facebook Instagram
    geekfence.comgeekfence.com
    • Home
    • UK Tech News
    • AI
    • Big Data
    • Cyber Security
      • Cloud Computing
      • iOS Development
    • IoT
    • Mobile
    • Software
      • Software Development
      • Software Engineering
    • Technology
      • Green Technology
      • Nanotechnology
    • Telecom
    geekfence.comgeekfence.com
    Home»iOS Development»ios – How to resolve the “Failed to build cache” build error in Xcode on macOS running in Docker in the docurr/macos project?
    iOS Development

    ios – How to resolve the “Failed to build cache” build error in Xcode on macOS running in Docker in the docurr/macos project?

    AdminBy AdminJuly 22, 2026No Comments3 Mins Read8 Views
    Facebook Twitter Pinterest LinkedIn Telegram Tumblr Email
    ios – How to resolve the “Failed to build cache” build error in Xcode on macOS running in Docker in the docurr/macos project?
    Share
    Facebook Twitter LinkedIn Pinterest Email


    I usually program in Android Studio, but for my first KMP project, I installed macOS in Docker in the docurr/macos project, copied my project to the macOS Documents folder, and developed it in Xcode. It’s a simple project (app.mercury) that opens a specified website using WebView.
    This is a link to the project repository
    Then I tried to build my project in Xcode, and I got the error:
    Failed to build cache for /Users/panfstas/.gradle/caches/modules-2/files-2.1/org.jetbrains.compose.ui/ui-uikitx64/1.7.3/88a91f9a95d1f2922311c28d558b3f805424d289/ui.klib.
    This is the build log as an attachment because it is very long
    The log after the error above contains the following line:
    “Details: Internal error in body lowering: java.lang.StackOverflowError: null”
    Than the main files of the project

    gradle/libs.versions.toml

    [versions]
    agp = "9.2.1"
    android-compileSdk = "36"
    android-minSdk = "24"
    android-targetSdk = "36"
    androidx-activity = "1.13.0"
    androidx-appcompat = "1.7.1"
    androidx-core = "1.19.0"
    androidx-espresso = "3.7.0"
    #androidx-lifecycle = "2.11.0-beta01"
    androidx-lifecycle = "2.8.4"
    androidx-testExt = "1.3.0"
    #composeMultiplatform = "1.11.1"
    #composeWebviewMultiplatform = "2.0.1"
    composeMultiplatform = "1.7.3"
    composeWebviewMultiplatform = "1.9.40"
    junit = "4.13.2"
    kotlin = "2.4.0"
    material3 = "1.11.0-alpha07"
    
    [libraries]
    kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
    kotlin-testJunit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin" }
    junit = { module = "junit:junit", version.ref = "junit" }
    androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "androidx-core" }
    androidx-testExt-junit = { module = "androidx.test.ext:junit", version.ref = "androidx-testExt" }
    androidx-espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "androidx-espresso" }
    androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "androidx-appcompat" }
    androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activity" }
    compose-uiTooling = { module = "org.jetbrains.compose.ui:ui-tooling", version.ref = "composeMultiplatform" }
    androidx-lifecycle-viewmodelCompose = { module = "org.jetbrains.androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "androidx-lifecycle" }
    androidx-lifecycle-runtimeCompose = { module = "org.jetbrains.androidx.lifecycle:lifecycle-runtime-compose", version.ref = "androidx-lifecycle" }
    compose-runtime = { module = "org.jetbrains.compose.runtime:runtime", version.ref = "composeMultiplatform" }
    compose-foundation = { module = "org.jetbrains.compose.foundation:foundation", version.ref = "composeMultiplatform" }
    compose-material3 = { module = "org.jetbrains.compose.material3:material3", version.ref = "composeMultiplatform" }
    compose-ui = { module = "org.jetbrains.compose.ui:ui", version.ref = "composeMultiplatform" }
    compose-components-resources = { module = "org.jetbrains.compose.components:components-resources", version.ref = "composeMultiplatform" }
    compose-uiToolingPreview = { module = "org.jetbrains.compose.ui:ui-tooling-preview", version.ref = "composeMultiplatform" }
    compose-webview-multiplatform = { module = "io.github.kevinnzou:compose-webview-multiplatform", version.ref = "composeWebviewMultiplatform"}
    
    [plugins]
    androidApplication = { id = "com.android.application", version.ref = "agp" }
    androidMultiplatformLibrary = { id = "com.android.kotlin.multiplatform.library", version.ref = "agp" }
    composeMultiplatform = { id = "org.jetbrains.compose", version.ref = "composeMultiplatform" }
    composeCompiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
    kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
    

    gradle.properties

    # Base Kotlin and Android settings
    kotlin.code.style=official
    android.nonTransitiveRClass=true
    android.useAndroidX=true
    
    # JDK 25
    org.gradle.daemon.jvm.criteria.version=25
    kotlin.jvm.toolchain.launcher.enabled=false
    kotlin.native.toolchain.enabled=false
    org.gradle.java.installations.auto-download=true
    org.gradle.java.installations.auto-detect=true
    
    # Memory and Metaspace
    org.gradle.jvmargs=-Xmx1024m -XX:MetaspaceSize=512m -XX:MaxMetaspaceSize=2048m -Dfile.encoding=UTF-8
    kotlin.daemon.jvmargs=-Xmx1024m
    org.gradle.workers.max=1
    kotlin.native.disableCompilerDaemon=false
    
    # Cache
    ompose.ios.uikit.cache.disabled=true
    org.gradle.configuration-cache=false
    org.gradle.caching=false
    

    shared/build.gradle.kts

    import org.jetbrains.kotlin.gradle.dsl.JvmTarget
    
    plugins {
        alias(libs.plugins.kotlinMultiplatform)
        alias(libs.plugins.androidMultiplatformLibrary)
        alias(libs.plugins.composeMultiplatform)
        alias(libs.plugins.composeCompiler)
    }
    
    kotlin {
        listOf(
            iosX64(),
            iosArm64(),
            iosSimulatorArm64()
        ).forEach { iosTarget ->
            iosTarget.binaries.framework {
                baseName = "Shared"
                isStatic = true
            }
        }
    
        android {
            namespace = "app.mercury.shared"
            compileSdk = libs.versions.android.compileSdk.get().toInt()
            minSdk = libs.versions.android.minSdk.get().toInt()
            compilerOptions {
                jvmTarget = JvmTarget.JVM_25
            }
            androidResources {
               enable = true
            }
            withHostTest {
               isIncludeAndroidResources = true
            }
        }
        
        sourceSets {
            androidMain.dependencies {
                implementation(libs.compose.uiToolingPreview)
            }
            commonMain.dependencies {
                implementation(libs.compose.runtime)
                implementation(libs.compose.foundation)
                implementation(libs.compose.material3)
                implementation(libs.compose.ui)
                implementation(libs.compose.components.resources)
                implementation(libs.compose.webview.multiplatform)
                implementation(libs.androidx.lifecycle.viewmodelCompose)
                implementation(libs.androidx.lifecycle.runtimeCompose)
            }
            commonTest.dependencies {
                implementation(libs.kotlin.test)
            }
        }
    }
    
    dependencies {
        androidRuntimeClasspath(libs.compose.uiTooling)
    }
    

    iosApp/iosApp/Info.plist

    
    
    
    
        CADisableMinimumFrameDurationOnPhone
        
        NSAppTransportSecurity
        
            NSAllowsArbitraryLoads
            
        
    
    
    

    In this module the main WebView logic is implemented.
    shared/src/commonMain/kotlin/app/mercury/App.kt

    package app.mercury
    
    import androidx.compose.foundation.layout.fillMaxSize
    import androidx.compose.material3.MaterialTheme
    import androidx.compose.runtime.Composable
    import androidx.compose.ui.Modifier
    import com.multiplatform.webview.web.WebView
    import com.multiplatform.webview.web.rememberWebViewState
    
    @Composable
    fun App() {
        MaterialTheme {
            val webViewState = rememberWebViewState("
            WebView(
                state = webViewState,
                modifier = Modifier.fillMaxSize()
            )
        }
    }
    

    Command line to create a Docker container:

    docker run
        -it
        --name macos-kmp-backend
        -p 9006:8006
        -p 4900:5900
        --device /dev/kvm
        --cap-add NET_ADMIN
        --security-opt seccomp=unconfined
        -e RAM_SIZE="15G"
        -e CPU_CORES="4"
        -v "C:\Users\panfs\AppData\Local\Docker\macOS\tahoe:/storage"
        --restart unless-stopped
        dockurr/macos
    



    Source link

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email

    Related Posts

    What’s New in Xcode 27

    July 30, 2026

    ios – iCloud Dashboard returns “Internal Error” when querying records across all containers

    July 27, 2026

    ios – Do Critical Alert (Apple) sounds play one at a time, or can two overlap?

    July 17, 2026

    ios – Bizarre animation issue in SwiftUI

    July 12, 2026

    security – How and where mnemonic/private keys are generated/stored in IOS for mobile non-custodial wallet

    July 7, 2026

    JSON All the Way Down

    July 3, 2026
    Top Posts

    Understanding U-Net Architecture in Deep Learning

    November 25, 202572 Views

    The Next Paradigm in Efficient Inference Scaling – The Berkeley Artificial Intelligence Research Blog

    May 16, 202640 Views

    Hard-braking events as indicators of road segment crash risk

    January 14, 202634 Views
    Don't Miss

    Framework’s Data Breach Revealed Customer Data: Here’s What to Know

    August 9, 2026

    Framework, a company best known for producing modular, highly repairable and customizable PCs and laptops,…

    Eutelsat hails 5G NTN to take on ‘American giants’

    August 9, 2026

    The Skills Modern Data Professionals Need in 2026

    August 9, 2026

    Bitcoin ETFs Just Pulled In $170 Million. Here’s What It Doesn’t Prove |

    August 9, 2026
    Stay In Touch
    • Facebook
    • Instagram
    About Us

    At GeekFence, we are a team of tech-enthusiasts, industry watchers and content creators who believe that technology isn’t just about gadgets—it’s about how innovation transforms our lives, work and society. We’ve come together to build a place where readers, thinkers and industry insiders can converge to explore what’s next in tech.

    Our Picks

    Framework’s Data Breach Revealed Customer Data: Here’s What to Know

    August 9, 2026

    Eutelsat hails 5G NTN to take on ‘American giants’

    August 9, 2026

    Subscribe to Updates

    Please enable JavaScript in your browser to complete this form.
    Loading
    • About Us
    • Contact Us
    • Disclaimer
    • Privacy Policy
    • Terms and Conditions
    © 2026 Geekfence.All Rigt Reserved.

    Type above and press Enter to search. Press Esc to cancel.