IntelliJ/Kotlin upgrade causing "Incompatible types" error? - corda

I updated IntelliJ and kotlin to their latest version a couple days ago. I assume it is one of these two actions that is causing my issue. IntelliJ started highlighting errors on my QueryCriteria statements that it didn’t previously:
QueryCriteria myQueryCriteria = new QueryCriteria.LinearStateQueryCriteria(null, singletonList(uuid), null, Vault.StateStatus.ALL);
Error:
Incompatible types. Found: 'net.corda.core.node.services.vault.QueryCriteria.LinearStateQueryCriteria', required: 'net.corda.core.node.services.vault.QueryCriteria'
I have always used this syntax because I then pass myQueryCriteria into a Query:
Vault.Page<myContractState> page = mockNodeA.getServices().getVaultService().queryBy(myContractState.class, myQueryCriteria);
The error doesn’t stop my tests from running. I’ve tried changing several settings but came to the realization I am better to ask people that are more familiar with java/kotlin/intelliJ/Corda before I make the problem worse.

Quick History:
Originally installed IntelliJ 2018.3 to 2019.3 – no issues
Upgraded to IntelliJ 2020.3.2 – no issues
Updated to IntelliJ 2021.1 – error appeared
I ended up going back to IntelliJ 2020.3.3 to make the error stop
Docs clearly say:
"Install the IntelliJ IDEA Community Edition. Corda supports IntelliJ IDEA versions 2017.x, 2018.x, 2019.x, and 2020.x; and Kotlin plugin version 1.2.71."
…so when I updated to 2021.1 I was out of the recommended version. When 2020.3.2 prompted me to update I didn’t realize it was going to take me to 2021.1 (my fault).
Background:
I am still really new to IntelliJ/Java but I tried everything I could think of the make the error go away and couldn’t fix it.
Kotlin Plugin:
2021.1 wouldn’t let me install the Kotlin Plugin 1.2.71 because it’s not supported.
IntelliJ 2019.3 Kotlin Plugin 1.3.61-release-IJ2019.3-1 = no error
IntelliJ 2020.3 Kotlin Plugin 203-1.4.10-release-IJ7717.8 = no error
IntelliJ 2021.1 Kotlin Plugin 211-1.4.32-release-IJ6693.72 = error
I tried downgrading the Kotlin Plugin to an older version but it would always ignore the older plugin and stay with the new one.
I tried changing the Inspections but the error doesn’t seem to be coming from an inspection.
Changing the Kotlin compiler under Build, Execution, Deployment had no effect.

The current supported version of Kotlin is 1.2.71 (you can check out the doc or the source code of Corda on github (github.com/corda/corda/constant.properties)).
I suggest you to downgrade the Kotlin version.

This does seem to be a compiler error in Intellij IDEA. I have the same issue as you, using code downloaded from Corda's repository.
IntelliJ IDEA 2021.3.1 (Ultimate Edition) = Error
IntelliJ IDEA 2021.3.1 (Community Edition) = Error
IntelliJ IDEA 2020.3.4 (Ultimate Edition) = WORKS!

Related

How to make Rider show API documentation again?

Since reinstalling with Fedora 32, Jetbrains Rider does not show XML documentation for external APIs like all the SDK classes and methods anymore:
As you can see, Rider does not show the method documentation, even though I know it's there and the Rider decompiler does show it too, when Ctrl+Clicking into the Slice method.
The official dotnet-sdk-3.1 package from the Fedora repositories is installed and works as normal.
Is there some setting that I missed and which allows me to fix/enable the documentation?
The issue disappeared after 2 weeks of system upgrades and restarting. No idea what caused this.

Why won't this .NET project compile?

I'm building a project as part of a course, I didn't build it from scratch but I've got it at a stable level that compiles perfectly with no errors or warnings.
I need to add Entity Framework Core. The video shows the instructor installing 2.1.4 even though the latest is 3.1.4. What the heck, I install the older version. Everything's still peachy.
But I don't want 2.1.4, I want 3.1.4. I won't go into the reasons, but suffice to say that version supports EDMX. Please don't question me on that. Incidentally I have 3 projects in the solution and only one of them had the EF Core installed. Does that matter? Anyway, after installing 3.1.4 in that one project I get this.
Error NU1107 Version conflict detected for Microsoft.EntityFrameworkCore. Install/reference Microsoft.EntityFrameworkCore 3.1.4 directly to project OdeToFood to resolve this issue.
OdeToFood -> OdeToFood.Data -> Microsoft.EntityFrameworkCore (>= 3.1.4)
OdeToFood -> Microsoft.AspNetCore.App 2.1.1 -> Microsoft.EntityFrameworkCore (>= 2.1.1 && < 2.2.0). OdeToFood D:\Visual Studio Projects\OdeToFood\OdeToFood\OdeToFood.csproj 1
OdeToFOod is the project, OdeToFood.Data is the one of three projects I added EF Core to.
Dear Microsoft, is it asking too much for you to give your error messages in something resembling English? I'm at my wits end with this stupid project. The error message SEEMS to be saying to install 3.1.4 directly to that project. Isn't that what I just did?! Perhaps they mean right-click the project and say manage Nuget for that project instead of "Manage Packages for Solution"? Doesn't make sense to me, but I'll try it. So when I do that it (obviously) already shows 3.1.4 as installed, so that can't be it. So why don't we start nice and fresh, huh? Let's uninstall 3.1.4 from that project and re-install.
Nope. Same error message except this time it mentions a different project, one that never had EF Core installed in the first place. Okay fine Microsoft, I'll play your game. So even though I have no use for it in this second project, I'll install it anyway. Let's see what happens shall we?
OMG.... DISASTER!!!! It's now worse! I still have that error message, but now I have a "package out of dependency constraint" (English please??) and it references ANOTHER package that now has a version conflict, one that hasn't even been touched. What the hell is going on here? I'll bet at this point I can't even go back to Core 2.1.4 anymore. There's got to be some config file or .csproj or something that I can edit because this is unbelievable. I'm trying to follow the directions as best as I can understand them (which isn't much) and it keeps getting worse. And not only that but it appears that EF Core never DID install on this other project anyway so I think there's no fixing this problem at this point, I'm going to have to restore from backup and start over. Why does Microsoft have to make everything so freaking complicated?! Can they at least make this a little more forgiving and user friendly so it doesn't take a PhD to figure out these errors?
I'm just a beginner at this but how am I supposed to learn this if I can't even get a simple thing like this to compile? I try to follow the directions as best I can and that only makes things worse. I'm ready to declare this project FUBAR, throw my computer through a window, buy a sheep farm and never code again!
We love Scott Allen and his tutorials :)
Seems like scoot have updated entity framework with latest version. Link below
GitHub Repository
If you want to update by yourself i suggest to remove ef Core 2.1 packages from odeToFood & OdeToFood.Data project and install ef core 3.1 in both project accordingly. Hopefully this will resolve the issue. Happy learning.

Proguard fails with firebase-messaging:17.3.4

Today, my Android build failed in the ProGuard optimization phase with a weird java.lang.ArrayIndexOutOfBoundsException error message.
Since my last successful build I hardly changed a thing. I tracked the problem to the version of the com.google.firebase:firebase-messaging api. Version 17.3.3 still works fine, version 17.3.4 is problematic.
I don't know if it is related, but note that the api com.google.firebase:firebase-core is not part of my project.
The issue seems fixed when using grade plugin 3.3 or later

Meteor Project not supported

I am trying to run a project on meteor but getting this error in the command line-
this project uses Meteor1.0.2.1, which isn't available on Windows. To
work with is app on all supported platforms, use ,meteor update
--release METEOR#1.1.0.2 to pin this app to the newest Windows-compatible release.
I have tried updating to which I am getting the error message
while checking for meteorhacks:kadira-binary-deps#1.2.1:error: No
compatible binary build found for this package. Contact the package
author and ask them to publish it for your platform.
I tried updating this to which i was brought back to the first error message.
Does anyone know how I can run this meteor package? It is sparrow-finance to be specific.
Regards
Chris
The answer is simply remove the kadira package which you can do by editing the packages file in .meteor.
But, kadira is really useful. So what I'd suggest is to set up meteor environments. Meteor cookbook has a good example of this - https://github.com/awatson1978/meteor-cookbook/blob/master/cookbook/environment-detection.md .
If your environment is anything other than local, use kadira, else don't use it.

Error after upgrading Flex SDK: "{ expected "

After upgrading the Flex SDK from 3.1 to any newer version of the SDK and trying to compile an existing project, the following error appears in the Problems pane:
Description: { expected
Resource: (shows project name, not a specific file)
Location: line 15
Any ideas how to solve this or where to start the bug hunt?
It looks like the problem is in the ...sdks/3.3.0/frameworks/libs/player/10/playerglobal.swc file, but I'm certainly not sure.
I've had this happen (among others). Never got to the bottom of it. In the end I migrated my code files to a new project. There are some pretty nasty bugs in FlexBuilder, especially when working on 64bit windows.
Have you tried to do a clean on the project? You didn't mention this but I assume that the project compiles fine under 3.1? If you create a new project does it compile cleanly (if not, it may mean that you have a bad download of the SDK and need to get a new copy.)
The problem was solved by removing halo.swc from libraries. Copying halo.swc to the project was suggested by an online tutorial (which I cannot find right now).

Resources