ionspin / kotlin-multiplatform-bignum

A Kotlin multiplatform library for arbitrary precision arithmetics
Apache License 2.0
350 stars 41 forks source link

Artifact Not Found: Kotlin 1.5.31 #188

Closed avjiang closed 2 years ago

avjiang commented 2 years ago

Hi, i am trying to integrate the library with a sample project of KMM application, but couldn't. I am facing ArtifactNotFoundException

Failed building KotlinMPPGradleModel
org.gradle.internal.resolve.ArtifactNotFoundException: Could not find bignum-0.3.2-samplessources.jar (com.ionspin.kotlin:bignum:0.3.2).
Searched in the following locations:
    https://repo.maven.apache.org/maven2/com/ionspin/kotlin/bignum/0.3.2/bignum-0.3.2-samplessources.jar
    at 

Below is my build.gradle.kts:

kotlin {
    android()
    ios()
    iosSimulatorArm64()

    sourceSets {
        val commonMain by getting {
            dependencies {
                implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.0-RC")
                implementation("com.ionspin.kotlin:bignum:0.3.2")
            }
        }
        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)
}

I am currently using M1 Mac with Android Studio:

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? Kindly assist please .. Thank you

ionspin commented 2 years ago

Hi @avjiang, usually when Android Studio or IntelliJ Idea report this "Could not find ... ...-samplessources.jar" it means that you have targets in your project that the library doesn't support. It's really an unhelpful message, but if you run ./gradlew build from the project root it should give you a more insightful error.

In any case I'm pretty sure the problem is iosSimulator64(), it;s a new target added in kotlin 1.5.30 and the library is still on 1.5.10 so I never built for that target.

As a temporary workaround you can remove the iosSimulator64() and it should build, and I'll try to bump the version of the library and add new targets to the build as soon as possible, although it will be available only in the snapshot at first.

Just for the record here are the new targets from kotlin 1.5.30:

avjiang commented 2 years ago

Ahh.. understand. Thanks mate for the information! Really appreciate the fast response.

ionspin commented 2 years ago

My pleasure! Let's keep the issue open until I release the version with the new targets and then we can close it.

ionspin commented 2 years ago

Hey @avjiang I've added new targets, they are available in snapshot version 0.3.3-SNAPSHOT. Tell me if you encounter any problems, especially since these new targets are for M1 hardware which I currently don't own. Forgot to say, thanks for reporting the issue in the first place!

avjiang commented 2 years ago

hi @ionspin thanks for the quick progress. in the meantime i am still waiting for the other library to add support for the architecture. so i may not able to test it now. will update u again once i have tested it. thanks!