joreilly / PeopleInSpace

Kotlin Multiplatform project with SwiftUI, Jetpack Compose, Compose for Wear, Compose for Desktop, and Compose for Web clients along with Ktor backend.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failed to gradle sync in Android Studio

dylanenabled opened this issue · comments

I cloned and opened the project in Android Studio Bumblebee 2021.1.1 Patch 2 with the KMM plugin 0.3.1(211-1.6.10-release-960-IJ)-89 and it gives this error after trying to perform the gradle sync:

org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all artifacts for configuration ':classpath' ....
Caused by: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve com.rickclephas.kmp:kmp-nativecoroutines-gradle-plugin:0.11.1-new-mm.
Required by:
    project :
Caused by: org.gradle.internal.component.NoMatchingConfigurationSelectionException: No matching variant of com.rickclephas.kmp:kmp-nativecoroutines-gradle-plugin:0.11.1-new-mm was found. The consumer was configured to find a runtime of a library compatible with Java 8, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '7.2' but:
  - Variant 'apiElements' capability com.rickclephas.kmp:kmp-nativecoroutines-gradle-plugin:0.11.1-new-mm declares a library, packaged as a jar, and its dependencies declared externally:
      - Incompatible because this component declares an API of a component compatible with Java 11 and the consumer needed a runtime of a component compatible with Java 8
      - Other compatible attribute:
          - Doesn't say anything about org.gradle.plugin.api-version (required '7.2')
  - Variant 'runtimeElements' capability com.rickclephas.kmp:kmp-nativecoroutines-gradle-plugin:0.11.1-new-mm declares a runtime of a library, packaged as a jar, and its dependencies declared externally:
      - Incompatible because this component declares a component compatible with Java 11 and the consumer needed a component compatible with Java 8
      - Other compatible attribute:
          - Doesn't say anything about org.gradle.plugin.api-version (required '7.2')
....

Are you still seeing this? It's not something I've come across fwiw....am currently using AS Chipmunk

Still not working for me after updating to the latest Android Studio and git commit

My Java version
➜ PeopleInSpace git:(main) java -version
openjdk version "11.0.15" 2022-04-19 LTS
OpenJDK Runtime Environment Corretto-11.0.15.9.1 (build 11.0.15+9-LTS)
OpenJDK 64-Bit Server VM Corretto-11.0.15.9.1 (build 11.0.15+9-LTS, mixed mode)

Weird, I noticed that for some reason Android Studio had picked up an old Java 1.8 JVM in the Build Tools -> Gradle Settings area.

Changing the Java version to Android Studio's bundles JDK 11 in the gradle settings has fixed the issue.