I'm trying to add the algolia kotlin client to my project, but all I'm left with is:
ERROR: Failed to resolve: com.algolia:algoliasearch-client-kotlin-jvm:1.3.61
According to algolias wiki
https://www.algolia.com/doc/api-client/getting-started/install/kotlin/?language=kotlin
All I have to to is add the maven repository (I assume to my project level gradle file?) and import the client (In the app level gradle file, I think)
I tried that but am left with the error message above.
if you use android, you can use:
implementation "com.algolia:algoliasearch-client-kotlin-android:1.3.1"
Important: starting from version 1.4.0 the library is compatible only
with kotlin version 1.3.70 or higher; for previous versions of kotlin,
please use version 1.3.1 of the library.
ref
Related
I am running into a compile error when trying to compile a project with Kotlin and Compose Multiplatform, I think due to the Compose 1.1.0 compiler extension not being compatible with Kotlin 1.6.21. Even though I set my Kotlin plugin version to 1.6.10:
plugins {
idea
kotlin("jvm") version "1.6.10"
id("org.jetbrains.compose") version "1.1.0"
}
I get this error:
Kotlin: kotlinc-jvm 1.6.21-release-334 (JRE 15+36-1562)
Kotlin: [Internal Error] java.lang.IllegalStateException: The provided plugin androidx.compose.compiler.plugins.kotlin.ComposeComponentRegistrar is not compatible with this version of compiler
I can't figure out how to set the version of the Kotlin compiler that is used. From the log above the error, I can see it's using version 1.6.21-release-334, rather than some 1.6.10 version.
An alternate possible solution would be to change the version of the Compose Kotlin Compliler plugin to a more recent alpha or beta version that supports Kotlin 1.6.21, but I can't figure out how to do that either. In an Android project, you would use:
android {
composeOptions {
kotlinCompilerExtensionVersion = "1.2.0-beta03"
}
}
However, I would rather solve this by setting the Kotlin compiler so I won't run into the issue again whenever the latest version of Kotlin outpaces the compatibility of the Compose Multiplatform Kotlin Compiler Plugin.
The main idea I was thinking about is that there are some other places in the existing project where the old version 1.6.21 was used or some other setups that require that version or maybe an old cache. So basically need to clean the project, even delete the .idea directory of the project, and check other places where the old version can be set. After that reopen the project, do cleanup, sync and rebuild it.
I'm trying to do some coroutine example represented on : https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/jvm/test/guide/example-basic-02.kt
and It's debugger not working properly.
As you see, even code about coroutine like 'runBlocking' or 'launch' is not detected by intellisense,
I don't know what is my problem.
First my project is kotlin Console program, and
What I've done to import kotlinx.coroutine to my project are :
at Project Structure, Module downloaded org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0-RC from Maven, when downloading checked Trasitive-something and Source, and added at library.
at Settings -> Build -> Kotlin compiler, changed language version and API version to 1.5, which is experimental version of Kotlin
at Project tool and build.gradle.kts, added
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0-RC") at dependencies,
kotlin("jvm") version "1.5.0" at plugins
Just run projects works well, but I can't use any context menu when using code about coroutine and as you know, it's really annoying me. any help would be appreciated.
I had the same problem but it seems to be fixed in 1.5.0. See https://youtrack.jetbrains.com/issue/KTIJ-11620
I meet this problem today, I use the latest the Coroutine library version and my kotlin version is 1.6.21 which is not the latest.
I just update my kotlin version to the latest version 1.8.10.
I got the error that states "Unsupported class file major version 57" while trying to build LibGdx project, along with few other notifications. Same happens when trying to build using IntelliJ idea.
I have no idea how to fix that.
"Unsupported class file major version 57" means your version of Java is incompatible with the one with which Gradle was compiled. You have to make sure that the Java version you are using is compatible to the Gradle version you are using. I guess you have either to downgrade your Java version or upgrade the Gradle version.
I have common library with own libraries and build tools for gradle. Like SDK. I updated kotlin to 1.2.71. All ok. I also updated kotlin dsl to newest RC release(no effect).
Then I have projects, which are using this mine SDK. Problem ocurred, when I switched to version 1.2.71 on those projects, because "BuildUtilKt.makeModuleFile" was removed.
Unable to find method 'org.jetbrains.kotlin.incremental.BuildUtilKt.makeModuleFile(Ljava/lang/String;ZLjava/io/File;Ljava/lang/Iterable;Ljava/lang/Iterable;Ljava/lang/Iterable;Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/io/File;'.
or
Unable to find method 'org.jetbrains.kotlin.cli.common.arguments.K2JSCompilerArguments.setCommonSources([Ljava/lang/String;)V'.
I know how to remove dependencies, when I have it in compile, but I don't know where from I am getting "kotlin-compiler-embeddable:1.2.41"
Tried:
- compileOnly("org.jetbrains.kotlin:kotlin-compiler-embeddable:1.2.71") in buildSrc
- runtime "org.jetbrains.kotlin:kotlin-compiler-embeddable:1.2.71"
it doesn't work.
Here are printed dependencies: gist
In intellij idea 16 EAP 144.3357.4 I have a pure Kotlin cmd project currently refusing to run with this error:
The binary version of its metadata is 1.0.1, expected version is 1.1.0
The project runs on the command-line - I invalidated caches and restarted Idea - nothing helped. Anyone had the same problem and found a way to get it working?
The problem seems to be mismatch between the kotlin library used in your project and the version of the plugin are not compatible.
Check the Kotlin plugin version and you'll most likely see something similar to:
Version: 1.0.0-rc-1007-IJ143-11
Then check the version of the Kotlin libraries by looking into META-INF/build.txt or META-INF/MANIFEST.MF and it'll most likely be other version like 1.0.0-beta-4589.
To resolve the problem update Kotlin libraries to version 1.0.0-rc-1007 which can be found in this maven repository: https://dl.bintray.com/kotlin/kotlin-eap.
Kotlin compiler marks each .class with #kotlin.Metadata to indicate, among others:
The version of the bytecode interface (naming conventions, signatures) of the class file annotated with this annotation.
That is how the compiler detected incompatibilities.