Unable to find a matching variant of com.badoo.reaktive
See original GitHub issueSetting up the dependencies for this lib gives me the following errors:
Unable to find a matching variant of com.badoo.reaktive:reaktive-android:1.1.8:
- Variant 'android-releaseApiElements' capability com.badoo.reaktive:reaktive-android:1.1.8:
- Incompatible attributes:
- Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found incompatible value 'release'.
- Required org.gradle.usage 'java-runtime' and found incompatible value 'java-api'.
- Other attributes:
- Found com.android.build.api.attributes.VariantAttr 'release' but wasn't required.
- Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
- Found org.gradle.status 'release' but wasn't required.
- Required org.jetbrains.kotlin.platform.type 'androidJvm' and found compatible value 'androidJvm'.
- Variant 'android-releaseRuntimeElements' capability com.badoo.reaktive:reaktive-android:1.1.8:
- Incompatible attribute:
- Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found incompatible value 'release'.
- Other attributes:
- Found com.android.build.api.attributes.VariantAttr 'release' but wasn't required.
- Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
- Found org.gradle.status 'release' but wasn't required.
- Required org.gradle.usage 'java-runtime' and found compatible value 'java-runtime'.
- Required org.jetbrains.kotlin.platform.type 'androidJvm' and found compatible value 'androidJvm'.
- Variant 'metadata-api' capability com.badoo.reaktive:reaktive-android:1.1.8:
- Incompatible attributes:
- Required org.gradle.usage 'java-runtime' and found incompatible value 'kotlin-api'.
- Required org.jetbrains.kotlin.platform.type 'androidJvm' and found incompatible value 'common'.
- Other attributes:
- Required com.android.build.api.attributes.BuildTypeAttr 'debug' but no value provided.
- Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' but no value provided.
- Found org.gradle.status 'release' but wasn't required.
It seems something gets confused about the build types?
Here’s the multiplatform gradle confiig:
import com.suparnatural.plugins.graphql.suparnaturalGraphQl
val serializationVersion by extra { "0.14.0" }
val coroutinesVersion by extra { "1.3.3" }
val reaktiveVersion by extra { "1.1.8" }
val graphQLVersion by extra { "1.0.9" }
plugins {
kotlin("multiplatform")
kotlin("plugin.serialization")
kotlin("native.cocoapods")
}
buildscript {
repositories {
maven(url="https://dl.bintray.com/suparnatural/kotlin-multiplatform")
}
dependencies {
classpath("com.suparnatural.plugins:graphql-plugin:1.0.8")
}
}
apply(plugin="com.suparnatural.plugins.graphql")
// CocoaPods requires the podspec to have a version.
version = "1.0"
kotlin {
// Add a platform switching to have an IDE support.
val buildForDevice = project.findProperty("kotlin.native.cocoapods.target") == "ios_arm"
if (buildForDevice) {
iosArm64("iOS64")
iosArm32("iOS32")
val iOSMain by sourceSets.creating
sourceSets["iOS64Main"].dependsOn(iOSMain)
sourceSets["iOS32Main"].dependsOn(iOSMain)
} else {
iosX64("iOS")
}
jvm("android")
sourceSets["commonMain"].dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib-common")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-runtime-common:$serializationVersion")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-common:$coroutinesVersion")
implementation("com.badoo.reaktive:reaktive:$reaktiveVersion")
implementation("com.badoo.reaktive:reaktive-annotations:$reaktiveVersion")
implementation("com.badoo.reaktive:coroutines-interop:$reaktiveVersion")
implementation("suparnatural-kotlin-multiplatform:graphql-metadata:$graphQLVersion")
implementation("suparnatural-kotlin-multiplatform:rx-runtime-reaktive-metadata:$graphQLVersion")
}
sourceSets["androidMain"].dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-runtime:$serializationVersion")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion")
implementation("com.badoo.reaktive:reaktive-android:$reaktiveVersion")
implementation("com.badoo.reaktive:reaktive-annotations-android-debug:$reaktiveVersion")
implementation("com.badoo.reaktive:coroutines-interop-android-debug:$reaktiveVersion")
implementation("suparnatural-kotlin-multiplatform:graphql-android-debug:$graphQLVersion")
// implementation("suparnatural-kotlin-multiplatform:graphql-android:$graphQLVersion")
implementation("suparnatural-kotlin-multiplatform:rx-runtime-reaktive-android-debug:$graphQLVersion")
// implementation("suparnatural-kotlin-multiplatform:rx-runtime-reaktive-android:$graphQLVersion")
}
sourceSets["iOSMain"].dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-serialization-runtime-native:$serializationVersion")
val isDevice = System.getenv("SDK_NAME")?.startsWith("iphoneos") == true
val reaktivePlatform = if (isDevice) "ios64" else "iossim"
val graphQLPlatform = if (isDevice) "iosarm64" else "iosx64"
implementation("com.badoo.reaktive:reaktive-$reaktivePlatform:$reaktiveVersion")
implementation("com.badoo.reaktive:reaktive-annotations-$reaktivePlatform:$reaktiveVersion")
implementation("com.badoo.reaktive:coroutines-interop-$reaktivePlatform:$reaktiveVersion")
implementation("suparnatural-kotlin-multiplatform:graphql-$graphQLPlatform:$graphQLVersion")
implementation("suparnatural-kotlin-multiplatform:rx-runtime-reaktive-$graphQLPlatform:$graphQLVersion")
}
}
suparnaturalGraphQl {
packageName = "com.********.********.graphql.models"
endpointUrl = "http://localhost:3000/graphql"
documentsPath = "../ios/Sources/**/*.graphql"
outputDirectoryPath = "src/commonMain/kotlin"
}
The app gradle config:
import org.jetbrains.kotlin.config.KotlinCompilerVersion
plugins {
id("com.android.application")
kotlin("android")
kotlin("android.extensions")
}
android {
compileSdkVersion(29)
buildToolsVersion("29.0.2")
defaultConfig {
applicationId = "com.**********.******"
minSdkVersion(15)
targetSdkVersion(29)
versionCode = 1
versionName = "1.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
getByName("release") {
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
}
}
dependencies {
implementation(project(":mobile-core"))
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
implementation(kotlin("stdlib-jdk7", KotlinCompilerVersion.VERSION))
implementation("androidx.appcompat:appcompat:1.1.0")
implementation("androidx.core:core-ktx:1.1.0")
implementation("androidx.constraintlayout:constraintlayout:1.1.3")
implementation("androidx.lifecycle:lifecycle-extensions:2.0.0")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.0.0")
testImplementation("junit:junit:4.12")
androidTestImplementation("androidx.test.ext:junit:1.1.1")
androidTestImplementation("androidx.test.espresso:espresso-core:3.2.0")
}
I tried changing the implementation(project(":mobile-core"))
to implementation(project(":mobile-core", configuration = "default"))
but that makes it so the Android implementation can’t find the shared code.
Any ideas how this can be fixed?
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
badoo/Reaktive: Kotlin multi-platform implementation ... - GitHub
This functionality is provided by the coroutines-interop module which is published in two versions: coroutines-interop:<version> is based on stable kotlinx.
Read more >React Native Unable to find a matching configuration of ...
Unable to find a matching configuration of project :react-native-fbsdk: None of the consumable configurations have attributes.
Read more >com.badoo.reaktive : reaktive : 1.2.1 - Maven Central
reaktive - Kotlin multi-platform implementation of Reactive Extensions.
Read more >Unable to find a matching variant of project - Help/Discuss
Everything builds ok when I'm using the gradle wrapper set to version 5.2. However when I upgrade to gradlew 5.4 I get the...
Read more >Kotlin Multiplatform Libraries
Kotlin multi-platform implementation of Reactive Extensions. Category: Reactive. Gradle: com.badoo.reaktive:reaktive:1.2.2. Kotlin: 1.6.21.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey @Drjacky, according to the error Reaktive’s repository is not in the list of checked repositories. I think you need to add Reaktive’s repository in your root
build.gradle
as follows:Let me know if you if it helps.
@arkivanov Yes, fixed, thanks. My fault, I had put it in
buildscript
scope not inallprojects
.