I had overridden Authservice.getOccUserId() on Spartacus in 2.x version , on spartacus 3.x version how do I override UsersIdService.getUserId() inject Store on the constructor without getting Circular dependency in DI detected for Store error
Related
I am trying to deploy this application to the Mule server.
It works on Anypoint Studio without a problem.
When I go to deploy it on the standalone server, it fails and in the logs, I find this error
java.lang.IllegalStateException: Incompatible version of plugin 'APIKit' (org.mule.modules:mule-apikit-module) found. Artifact requires version '1.6.0' but context provides version '1.5.5'
What's weird is that the version of APIKit I used on the app is 1.6.0 which I upgraded from 1.5.5.
The app is using a domain, and the dependencies' versions between the domain and the app are the same.
What can be the solution to this problem?
It looks like the domain is really using the dependency for APIKit 1.5.5. Another reason could be some incompatible version of the REST Validator Extension as mentioned in the documentation. Also if the domain or the application is using a jar library to import common Mule configurations it may be referring to a different version of the APIKit module. You can take a look at the logs to see what versions are being deployed.
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.
So I'm writing a plugin using Kotlin and in such plugin (my plugin), I install other plugins.
From the project object I can access the plugins field, and its methods. Yet there's no method that allows me to pick the version I'm gonna install of the plugin.
Basically I want to do the equivalent of
plugins{
id "org.jetbrains.kotlin.jvm" version "1.6.21"
}
But in my plugin the only available object (project.plugins) is of type PluginContainer, which basically only has the method apply(String) and the method apply(Class<?>). How do I specify the version of the plugin using this interface?
I'll call the plugin you're developing "your plugin" and the plugin you want to apply as the "sub plugin".
To specify the version of the sub plugin, in the build.gradle of your plugin, you specify the GAV (group:artifact:version) of the sub plugin, and it's that version that'll be used when you apply the sub plugin in your plugin.
I’m creating a multiplatform for jvm and iOS on kotlin using Gradle.
For the jvm, even if I define my dependencies as implementation, they are included in the library generated .pom and with runtime scope.
By using implementation, I was expecting that these dependencies are not passed to the library consumer.
But, when I use this library on my other jvm project, Gradle is importing the library-specific version. Not the one that I set in my application dependencies.
in this case, I'm doing a downgrade. The library is using the dependency version 1.4.1, and on the application I want to use version 1.4.0.1.
By using implementation, I was expecting that these dependencies are not passed to the library consumer.
If you expect the consumers to provide those transitive dependencies themselves, you should use compileOnly instead of implementation.
The difference between api and implementation is that transitive dependencies declared with api will be visible and usable by the application by just depending on your library (seen at compile time AND runtime). With implementation, the transitive dependency will still be here at runtime but will not be visible on the compile classpath of the consuming application, so you cannot use the transitive dependency's declarations in the application's code.
Have a look at the table here:
https://docs.gradle.org/current/userguide/java_library_plugin.html
If you stick with implementation, you can still force a version for the transitive dependency in Gradle by using strictly or by excluding it and redeclaring it yourself. See the doc:
https://docs.gradle.org/current/userguide/dependency_downgrade_and_exclude.html
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