Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

378
Views
KMM error: This API is internal in ktor and should not be used. It could be removed or changed without notice

After updating Xcode to 13.0, I cannot run my iOS app which is using Kotlin Multiplatform.
Build fails with Command PhaseScriptExecution failed with a nonzero exit code, and it says that the error is:

Task :shared:compileKotlinIos FAILED
e: /Users...path.../KtorClient.kt: (134, 17): This API is internal in ktor and should not be used. It could be removed or changed without notice.

We have also had similar errors after updating to Xcode 13, but it is always something with shared KMM library, JDK etc... This error showed many times:
> Process ‘command ‘/Library/Java/JavaVirtualMachines/jdk-11.0.12.jdk/Contents/Home/bin/java’' finished with non-zero exit value 1

134 line of KtorClient.kt:

override suspend fun createPassword(email: String, password: String): CreatePasswordResponse {
        return client.post {
            url {
                path("v1", "user", "create_password")
                body = LoginRequest(email, password)
            }
            headers {
/*134.line*/    append(HttpHeaders.ContentType, ContentType.Application.Json)
            }
        }
    }

We have tried deleting XCWorkspace, Podfile.lock, Pods folder, then pod reinstalling, deleting derived data, nothing helped.

We have also tried different versions of Ktor, JDK, nothing helped.

Also this command found on the Internet didnt help(they say you should run it after updating Xcode):

sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

This is a known issue of Ktor, related to this fix in Kotlin.

Here's what documentation says:

Note that the StringValuesBuilder class that exposes the append function is incorrectly marked with the InternalAPI annotation. This issue will be fixed in v2.0.0. As a workaround, you can add the @OptIn(InternalAPI::class) annotation to explicitly opt-in to use this API.

You can opt-in your specific line with @OptIn(InternalAPI::class), or add this in your shared module build.gradle.kts to take effect on the whole module:

kotlin {
    // ..
    sourceSets {
        all {
            languageSettings.optIn("io.ktor.util.InternalAPI")
        }
        // ...
    }
}
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!