treslines / kotlin_multiplatform_mobile

Desafios e resoluções a problemas relacionados ao desenvolvimento multiplataforma para mobile
75 stars 3 forks source link

Resolved Version Conflicts in Kotlin Standard Library #1

Open andyromerodev opened 11 months ago

andyromerodev commented 11 months ago

Problem Description: While working on the project, I encountered version conflicts in the Kotlin Standard Library. Different parts of the project were referencing different versions of the Kotlin Standard Library, which was causing inconsistencies and potential runtime errors.

Steps to Reproduce:

  1. Clone the repository.
  2. Run ./gradlew build or build the project through the IDE.
  3. Observe the version conflicts in the console output.

Proposed Solution: I have introduced a resolution strategy in the Gradle configuration to force the use of a specific version (1.8.21) of the Kotlin Standard Library across all project configurations. This ensures that only this specific version is used, thereby resolving the version conflicts.

configurations.all {
    resolutionStrategy {
        force("org.jetbrains.kotlin:kotlin-stdlib:1.8.21",
            "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.21",
            "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.21")
    }
}

Result: The project now builds successfully without version conflicts, and all modules are using the same version of the Kotlin Standard Library.

treslines commented 11 months ago

@andyromerodev Hey Andy, thanks for pointing out this. could you create a pull request for it? so I could test and merge it? would be super helpful! Thanks!

andyromerodev commented 10 months ago

I have already made the pull request

Set specific Kotlin standard library version (1.8.21) in Gradle

andyromerodev commented 9 months ago

@andyromerodev Hey Andy, thanks for pointing out this. could you create a pull request for it? so I could test and merge it? would be super helpful! Thanks!

Hello, have you been able to review my proposal to the code? Thanks