Vivek Modi
05/24/2022, 3:06 PMVivek Modi
05/24/2022, 3:10 PMCould not resolve all task dependencies for configuration ':iosX64CompileKlibraries'.> Could not resolve org.jetbrains.kotlinxkotlinx coroutines android1.4.1. Required by: project : > io.insert-koinkoin android3.2.0 > androidx.activityactivity ktx1.4.0 > androidx.lifecyclelifecycle runtime ktx2.3.1 project : > io.insert-koinkoin android3.2.0 > androidx.activityactivity ktx1.4.0 > androidx.lifecyclelifecycle viewmodel ktx2.3.1 > No matching variant of org.jetbrains.kotlinxkotlinx coroutines android1.4.1 was found. The consumer was configured to find a usage of 'kotlin-api' of a library, preferably optimized for non-jvm, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native', attribute 'org.jetbrains.kotlin.native.target' with value 'ios_x64' but: - Variant 'apiElements' capability org.jetbrains.kotlinxkotlinx coroutines android1.4.1 declares an API of a library: - Incompatible because this component declares a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm' and the consumer needed a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native' - Other compatible attributes: - Doesn't say anything about its target Java environment (preferred optimized for non-jvm) - Doesn't say anything about org.jetbrains.kotlin.native.target (required 'ios_x64') - Variant 'runtimeElements' capability org.jetbrains.kotlinxkotlinx coroutines android1.4.1 declares a runtime of a library: - Incompatible because this component declares a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm' and the consumer needed a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native' - Other compatible attributes: - Doesn't say anything about its target Java environment (preferred optimized for non-jvm) - Doesn't say anything about org.jetbrains.kotlin.native.target (required 'ios_x64')
Vivek Modi
05/24/2022, 3:10 PMplugins {
kotlin("multiplatform") version "1.6.21"
kotlin("native.cocoapods") version "1.6.21"
id("com.android.library")
id("maven-publish")
}
val libraryVersion = "0.0.1"
var libraryGroup = "com.vivek"
var libraryArtifactId = "kmm-module"
repositories {
google()
mavenCentral()
}
kotlin {
android {
publishLibraryVariants("release", "debug")
}
cocoapods {
version = libraryVersion
name = "VivekMyCocoaPod"
framework {
baseName = "MyFramework"
isStatic = false
}
}
iosX64()
iosArm64()
iosSimulatorArm64()
sourceSets {
val commonMain by getting{
dependencies {
implementation("io.insert-koin:koin-core:3.2.0")
implementation("io.insert-koin:koin-android:3.2.0")
}
}
val androidMain by getting
val iosX64Main by getting
val iosArm64Main by getting
val iosSimulatorArm64Main by getting
val iosMain by creating {
dependsOn(commonMain)
iosX64Main.dependsOn(this)
iosArm64Main.dependsOn(this)
iosSimulatorArm64Main.dependsOn(this)
}
}
}
android {
compileSdk = 21
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
defaultConfig {
minSdk = 21
targetSdk = 31
}
@Suppress("UnstableApiUsage") compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}
publishing {
publications {
group = libraryGroup
publications.withType<MavenPublication> {
groupId = libraryGroup
artifactId = libraryArtifactId
version = libraryVersion
}
repositories {
maven {
url = uri("<https://maven.pkg.github.com/vivek-modi/kotlinmultiplatfromproject>")
credentials {
username = (System.getenv("GITHUB_USER") ?: project.properties["GITHUB_USER"]).toString()
password = (System.getenv("GITHUB_PERSONAL_ACCESS_TOKEN") ?: project.properties["GITHUB_PERSONAL_ACCESS_TOKEN"]).toString()
}
}
}
publications.withType<MavenPublication> {
println(artifactId)
artifactId = if (name == libraryArtifactId) {
artifactId.toLowerCase()
} else {
"$artifactId-$name".toLowerCase()
}
}
}
}
ephemient
05/24/2022, 3:21 PMVivek Modi
05/24/2022, 3:24 PM