What does the warning «Use properties from the build variant packages» mean? - kotlin

What does this warning mean?
It is appeared in version 1.0.0-beta-3595 for all usages of kotlin android extensions in my code.

I think they did this to support multiple build variants. For example when you have a flavour proversion and you want to use a layout from that flavour you have to use
import kotlinx.android.synthetic.proversion.activity_main.*
For the main build variant you have to use
import kotlinx.android.synthetic.main.activity_main.*

Not strictly the answer to the question 'why did they do that', but that's how to eliminate warning.
Change
import kotlinx.android.synthetic.activity_main.*
to
import kotlinx.android.synthetic.main.activity_main.*
implying that you already bumped version in build.gradle and updated IDEA (or AS) kotlin plugins.

Related

How to import a dependency's .vue file

I encountered this line of code in a vue project here https://github.com/InfinetyEs/Nova-Filemanager/blob/c6595c29e23cab01be6b7e37a069b13844397c91/resources/js/modules/Image.vue#L42:
import Viewer from 'v-viewer/src/component.vue';
I know from other examples that v-viewer is the dependency, so src/component.vue isn't part of this project. However, those other examples are only importing the dependency, i.e. import Viewer from 'v-viewer'.
The issue I'm facing is that npm run dev is complaining that it cannot find the dependency and I have practically 0 experience with vue.
What is the proper way to write the above so that it is pulling component.vue from the dependency v-viewer?
Thank you!
UPDATE: I wrote this import { component } from 'v-viewer' and it compiled. Appreciate if someone can confirm and explain if what I'm doing is correct.
The project relies on v-viewer internals, which is a dangerous thing to do because they aren't guaranteed to exist.
This is the case here. There is loose version constraint, "v-viewer": "^1.4.2", and src was removed in later versions. You can either fix it to be "v-viewer": "1.4.2", or import and use it like shown in the documentation:
import { component as Viewer } from "v-viewer"
The latter solution is more preferable because this is the way the package was designed to be used without relying on its internals.

Migrating existing Karate project from Version 0.8.0 to 0.9.5

I'm trying to migrate existing Karate project from 0.8.0 to 0.9.5
but facing some issues like below
1)None of the below imports are working, Need to figure it out equalling ones from 0.9.5
Looking for help from other, who has already tried this
import com.intuit.karate.cucumber.CucumberUtils;
import com.intuit.karate.cucumber.FeatureWrapper;
import com.intuit.karate.cucumber.KarateFeature;
import com.intuit.karate.cucumber.KarateJunitAndJsonReporter;
import com.intuit.karate.cucumber.KarateJunitFormatter;
import com.intuit.karate.cucumber.KarateReporter;
import com.intuit.karate.cucumber.KarateRuntime;
import com.intuit.karate.cucumber.KarateRuntimeOptions;
import com.intuit.karate.cucumber.KarateStats;
import com.intuit.karate.filter;
2)import com.intuit.karate.cucumber.CucumberRunner;- stating as Deprecated already, need to know replacement of this, my baseClass extends CucumberRunner.
3)also need to know replacement for below also
import com.intuit.karate.cucumber.FeatureFilePath;
import com.intuit.karate.cucumber.FeatureWrapper;
import com.intuit.karate.ScriptContext;
above imports are using in parsing Feature file
public static FeatureFilePath parseFeaturePath(File file) {
Please suggest tips to get this migration done successfully.
Thank you,
Jay
Sorry, only KarateStats was designed as a public API which is replaced by com.intuit.karate.Results. And CucumberRunner is replaced by com.intuit.karate.Runner. These are clearly mentioned in the release notes for 0.9.0.
The core of Karate was completely written and things like the KarateFeature and FeatureWrapper don't even exist anymore. I would say whoever decided to use or extend these classes made a very bad decision, and we never documented or encouraged any such approach. All the best !

how kotlin use stdlib.jar?

I'm new in Kotlin, nowadays there is a problem disturbed me for a long time. I find we didn't import any packages or classes when we use functions such as let which defined in kotlin-stdlib.jar. I'm curious about how it works in such way.
It works the same was as it works in Java for the java.lang package: some Kolin packages are automatically imported.
See the documentation

IntelliJ: cannot resolve smybol in "org.apache.commons.lang3.tuple.ImmutablePair"

I am working on a web visualisation for a given project (db with genes, proteins, task is to do some nice visualisation with springboot and thymeleaf). The project was provided with all files, yet I am missing some libraries (also leading to some errors in the code ofc).
When trying to import:
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
lang3 gives me a "cannot resolve symbol" error and automatically searching jars on web results in "no jars found".I found the lang3-jar manually and successfully added it to the project library. When importing:
import org.apache.commons.lang3.*;
All errors for tuple.Pair-usage are gone. Yet, usage of ImmutablePair still results in a "cannot resolve symbol" error.
Firstly, I am confused and now unsure, if my knowledge of imports is correct. I learned, if for example you import something.anything.x and something.anything.y, you could also just import something.anything.*; and x and y would be covered.
Secondly, if needed, where do I find the jars I need (I could not find them yet).
Thanks :)
So, I do not know, where this error results in, yet I do know a solution. When adding the library, select "From Maven" and search for Apache lang3 and add it. Resolves the problems.

IntelliJ not respecting import ordering on 'Optimizing imports'

I have an import ordering setup in IntelliJ:
But when I do Ctrl + alt + O to optimize my imports, it shoves the google imports on top followed by the company imports and does not insert a blank line either. Anything I'm missing here?
Notice how the import packages are displayed:
import com.company.*.* and import com.google.*.*
vs
import java.* and import javax.*
When you specify the package name do not add .* at the end (i.e you have written com.company.*, but you should write com.company instead).
There is a bug listed in IntelliJ's IDEA's bug tracker IDEA-142468 which I believe describes this issue. It appears to particularly not work well when attempting to list static imports first. Unfortunately, I don't see much of a resolution or workaround within that ticket.
While these aren't completely satisfying, here's what I suggest:
Voting for that issue within IDEA's bug tracker system, and perhaps commenting referencing your screenshots of your configuration and how it isn't working for you, if you think doing so may help them understand the conditions of the problem.
Somehow dealing with the problem until the bug is fixed, either by seeing if it's acceptable to your team to have the static imports at the bottom (assuming that it fixes the problem), or otherwise using IDEA's default import ordering. (Which is pretty lousy suggestion, I admit, I'm just not sure what else to suggest if IntelliJ IDEA isn't working and you want to continue using it.)
If you have a support contract with Jetbrains, you could try contacting support to see if they have further suggestions, and to ensure that they know how this bug is affecting your productivity using their tools.