Skip to content

ArtifactNotFoundException Kotlin 1.5.31 #144

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
avjiang opened this issue Sep 22, 2021 · 2 comments
Closed

ArtifactNotFoundException Kotlin 1.5.31 #144

avjiang opened this issue Sep 22, 2021 · 2 comments

Comments

@avjiang
Copy link

avjiang commented Sep 22, 2021

Hi guys, i am trying to link the library to a new sample project of KMM application, and faced this issue

Failed building KotlinMPPGradleModel
org.gradle.internal.resolve.ArtifactNotFoundException: Could not find kotlinx-datetime-0.2.1-samplessources.jar (org.jetbrains.kotlinx:kotlinx-datetime:0.2.1).
Searched in the following locations:

This is my build.gradle.kts file:

kotlin {
    android()
    ios()
    iosSimulatorArm64()

    sourceSets {
        val commonMain by getting {
            dependencies {
                implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.0-RC")
                implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.2.1")
            }
        }
        val commonTest by getting {
            dependencies {
                implementation(kotlin("test-common"))
                implementation(kotlin("test-annotations-common"))
            }
        }
        val androidMain by getting
        val androidTest by getting {
            dependencies {
                implementation(kotlin("test-junit"))
                implementation("junit:junit:4.13.2")
            }
        }
        val iosMain by getting
        val iosSimulatorArm64Main by getting
        val iosTest by getting
    }

    cocoapods {
        framework {
            // Configure fields required by CocoaPods.
            summary = "Some description for a Kotlin/Native module"
            homepage = "Link to a Kotlin/Native module homepage"
            // Framework name configuration. Use this property instead of deprecated 'frameworkName'
            baseName = "SharedCode"
        }
    }
}

Below is my project build.gradle.kts:

buildscript {
    repositories {
        google()
        gradlePluginPortal()
        mavenCentral()
    }
    dependencies {
        classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31")
        classpath("com.android.tools.build:gradle:7.0.2")
    }
}

allprojects {
    repositories {
        google()
        mavenCentral()
    }
}

tasks.register("clean", Delete::class) {
    delete(rootProject.buildDir)
}

Android Studio: M1 Mac

Android Studio Arctic Fox | 2020.3.1 Patch 2
Build #AI-203.7717.56.2031.7678000, built on August 27, 2021
Runtime version: 11.0.10+0-b96-7249189 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 11.6
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 8
Registry: external.system.auto.import.disabled=true
Non-Bundled Plugins: org.jetbrains.kotlin, com.jetbrains.kmm

What am I missing here? please help

@dkhalanskyjb
Copy link
Collaborator

The reason for this error is that the latest release of the datetime library doesn't support the iosSimulatorArm64 target.

@dkhalanskyjb
Copy link
Collaborator

Should be fixed in the latest release, please try kotlinx-datetime 0.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants