autaut03 / kottle

Kotlin language provider for Forge 1.13.2+
GNU Lesser General Public License v3.0
30 stars 13 forks source link

Can't build project (tried with Roomery also) #1

Closed SirLyle closed 5 years ago

SirLyle commented 5 years ago

Whenever I try to build a project I get a "CANONICAL" error on the ":compileKotlin" task.

The error also occurs when trying to build your roomery mod.

(.txt files because the debug and stacktrace exced pastebin's limit) Log for ./gradlew build Log for ./gradlew build --debug Log for ./gradlew build --stacktrace

autaut03 commented 5 years ago

I was able to reproduce the issue only on Linux. Not sure what the issue exactly is, but as of kotlin 1.3.20 and 1.3.21 the issue remains, so I had to downgrade it to 1.3.11 for now.

SirLyle commented 5 years ago

Looks like it can build even with the current Kottle by changing the dependent project's build.properties. Does this fix only need to be made to the projects using Kottle; or does Kottle need to be "up"dated.

autaut03 commented 5 years ago

Ah, I just restarted back to Windows :/

Regardless if it works by changing dependent's project kotlin version, we should probably keep the versions synced, just in case. So what I would recommend is to change Kotlin version of your dependent project to 1.3.11 and update to Kottle 1.0.2 (it's on curseforge already) for now.

I'll keep you updated on issue's progress. This isn't really something that I'm in control of, but I'll try my best to find out what happens, why and then address the issue on kotlin's bug tracker.

SirLyle commented 5 years ago

It doesn't appear to work actually (compiles but doesn't run). It also now has a different error when running with the proper Kottle:

latest.log debug.log

Perhaps some parts of the Kotlin language aren't being properly included in Kottle?

autaut03 commented 5 years ago

I should test releases better, sorry for that.

shadowJar plugin worked kind of unexpected and just didn't include stdlib in the build. Turns out other kotlin deps (coroutines and annotations) also need to be downgraded, so that's what I did.

I tested new release with roomery, should be working fine now.

SirLyle commented 5 years ago

Note to anyone else reading: autaut03 uploaded the fixed 1.0.3 jar with the same version, so if you had grabbed it before the reupload you will need to clear your gradle cache (on linux: ~/.gradle/caches).

But now a new and stranger error:

java.lang.ClassCastException: net.alexwells.kottle.FMLKotlinModContainer cannot be cast to net.minecraftforge.fml.ModContainer

Which makes no sense, since you're clearly are extending it.

crash-2019-02-18_20.53.26-client.txt

autaut03 commented 5 years ago

I'm not sure what you mean by "with the same version" - latest update is 1.0.3, and before that there was only 1.0.2.

This is due to different class loader being used accross Forge, I've had this problem earlier. However, it was fixed in Forge build 25.0.15, so first make sure that you use this build or newer.

Then, make sure that you have Kottle inside of run/mods folder, even in dev environment.

Also, in case you're trying to run kottle's test sources, then the fix for this is in progress (which has been made possible with recent changes to forge gradle's runs config system changes).

If you're trying to run your own mod, you're sure about meeting both requirements and the issue persists, then I will have to ask you to temporarily enable CLASSLOADING and CORE logging markers, as well as lower logging level to trace, under minecraft -> runs -> client in the gradle configuration. Then send the debug.log.

I'm running 1.0.3 version of Kottle for Roomery development, so it should be working. So hopefully this is just a documentation issue.

SirLyle commented 5 years ago

My last crash appears to have been caused by the run/mods folder not containing Kottle. Thank you for your help and for making this. I can at least launch Roomery.

autaut03 commented 5 years ago

No problem, I've fixed it in the docs, so it's a bit less poor and ugly :) Feel free to post more issues you encounter.

SirLyle commented 5 years ago

Working on re-implementing ex nihilo creatio; it's building and running. Will let you know if anything comes up.