Vivek Modi
05/19/2022, 8:27 AMVivek Modi
05/19/2022, 8:29 AMbuild.gradle.kts
plugins {
kotlin("multiplatform") version "1.6.21"
id("com.android.library")
id("maven-publish")
}
group = "com.abc"
version = "0.0.1"
repositories {
google()
mavenCentral()
}
kotlin {
android {
publishLibraryVariants("release", "debug")
}
android()
iosX64()
iosArm64()
iosSimulatorArm64()
sourceSets {
val commonMain by getting
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 {
repositories {
maven {
name = "KotlinMultiplatformMobile"
url = uri("<https://maven.pkg.github.com/Vivek/KotlinMultiplatformMobile>")
credentials {
username = "vivek-modi"
password = "abc"
}
}
}
}
Paul Woitaschek
05/19/2022, 8:31 AMVivek Modi
05/19/2022, 8:32 AMerror
when use ./gradlew publish
> Task :publishAndroidDebugPublicationToKotlinMultiplatformMobileRepository FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':publishAndroidDebugPublicationToKotlinMultiplatformMobileRepository'.
> Failed to publish publication 'androidDebug' to repository 'KotlinMultiplatformMobile'
> Could not PUT '<https://maven.pkg.github.com/vivek/KotlinMultiplatformMobile/com/abc/VivekKotlinMultiplatform-android-debug/0.0.1/VivekKotlinMultiplatform-android-debug-0.0.1.aar>'. Received status code 422 from server: Unprocessable Entity
Vivek Modi
05/19/2022, 8:34 AMVivek Modi
05/19/2022, 8:34 AMGrégory Lureau
05/19/2022, 8:35 AMPaul Woitaschek
05/19/2022, 8:35 AMPaul Woitaschek
05/19/2022, 8:36 AMPaul Woitaschek
05/19/2022, 8:36 AMVivek Modi
05/19/2022, 8:37 AMPaul Woitaschek
05/19/2022, 8:38 AMkotlin artifactid
Paul Woitaschek
05/19/2022, 8:39 AMVivek Modi
05/19/2022, 8:42 AMpublications.withType<MavenPublication> {
artifactId = "com.abc"
}
I set this and getting same errorPaul Woitaschek
05/19/2022, 8:43 AMVivek Modi
05/19/2022, 8:44 AMname
what he trying to check in if condition? what should I check?Paul Woitaschek
05/19/2022, 8:46 AMViveKotlinMulti...
?Vivek Modi
05/19/2022, 8:48 AMpublications.withType<MavenPublication> {
artifactId = if (name == "vivekkotlinmultiplatformmobile") {
artifactId
} else {
"$artifactId-$name"
}
}
like this?Paul Woitaschek
05/19/2022, 8:49 AMVivekKotlinMulti...
anywhere?Vivek Modi
05/19/2022, 8:50 AMbuild.gradle.kts
Vivek Modi
05/19/2022, 9:26 AM* What went wrong:
Execution failed for task ':publishKotlinMultiplatformPublicationToKotlinMultiplatfromProjectRepository'.
> Failed to publish publication 'kotlinMultiplatform' to repository 'KotlinMultiplatfromProject'
> Could not PUT '<https://maven.pkg.github.com/vivek-modi/KotlinMultiplatfromProject/me/vmodi/KotlinMultiplatfromProject-kotlinMultiplatform/1.0.0/KotlinMultiplatfromProject-kotlinMultiplatform-1.0.0.jar>'. Received status code 422 from server: Unprocessable Entity