GithubHelp home page GithubHelp logo

Compilation Failed about kotlin-koans HOT 15 OPEN

akki777-zz avatar akki777-zz commented on June 18, 2024
Compilation Failed

from kotlin-koans.

Comments (15)

mictaege avatar mictaege commented on June 18, 2024 2

I got this problem also when I work on Lesson 1/Task2.kt, when I click Check, it tips compilation failed.
can anyone help me ? note: I work on android studio V3.4.1, and my PC is windows 7

I have the same problem and my Android Studio version is 3.5.1

Exactly the same with IntelliJ IDEA 2019.3.4, latest Kotlin and EduTools plugins and jdk1.8.0_191

from kotlin-koans.

jimandreas avatar jimandreas commented on June 18, 2024

I just tried the EduTools JetBrains plugin on IntelliJ IDEA 2018.1.1 and it seems to work OK.
However I find it critical to look at the unit tests as I work on the solution to the koan - and I don't see where you can get a view of the unit test in the plugin. I recommend pulling in the repo to a folder on your hard drive by:

File->New->Project from Version Control->Git and then download the Koans repo:

https://github.com/Kotlin/kotlin-koans

Then you can run the Junit tests in the Project kotlin-koans/test hierarchy as you do the work. Just right click on the tests (Windows) and run or debug them. The IDE gives you lots of useful feedback about type information, runtime library help, and links to the documentation. Don't forget the links to the documentation as pointed out in the 0 Hello World entry (click on doc reference and on Windows hit Control-Q). Also use "Control B" to pop to declarations and Control-Alt-leftArrow to pop back to your work. Enjoy!!

from kotlin-koans.

akki777-zz avatar akki777-zz commented on June 18, 2024

I realised recently @haposik has also raised the same issue (with the screenshot).
#148. Please look at this issue to get a clear view.

from kotlin-koans.

jimandreas avatar jimandreas commented on June 18, 2024

You might try running the Junit test manually and look for details on the build errors.

Try switching to the Project Files view in the Project tool window, then navigate to lesson2 / task6 / lesson2-task6_test (the task shown by @haposik) or to your particular lesson. Then you can run the test manually as indicated in the screenshot below. The View / Tool Windows / { Messages and Build } windows might have hints about the compiler complaints.

koansmanually

To switch back to plug in mode, select "Course" in the project window.

from kotlin-koans.

akki777-zz avatar akki777-zz commented on June 18, 2024

I find this as a bug..so this should be solved, instead of finding a workaround.

from kotlin-koans.

jimandreas avatar jimandreas commented on June 18, 2024

What compiler errors are you seeing? This information should be in the View / Tool Windows / { Messages and Build } windows as you are seeing a compile errors. If you post your compile errors then the IntelliJ people will have clues about the problem.

from kotlin-koans.

akki777-zz avatar akki777-zz commented on June 18, 2024

Following is the Error in Problems window. @jimandreas . And I have not touched this file.
screen shot 2018-05-08 at 6 43 57 pm

This issue also has the screenshot -> #148

from kotlin-koans.

jimandreas avatar jimandreas commented on June 18, 2024

The lesson6 / task1 problem (Generics) is the last problem in project. It doesn't compile until you get the whole solution right. I confess I had to peek at the solution. Spoiler - my modified solution is below - if you paste this solution over the top of the:

fun partitionTo() = TODO()

line in the problem - this should compile and solve the problem. The solution is quite tricky - the syntax has to be exactly correct before the compile errors disappear. TYP = type of items in the collections, and COLL = the "flavor" (HashSet or ArrayList in this case) of the collection.

fun <TYP, COLL: MutableCollection<TYP>> Collection<TYP>.partitionTo(
        list1: COLL, list2: COLL, predicate: (TYP) -> Boolean)
        : Pair<COLL, COLL> {
    for (item in this) {
        if (predicate(item)) {
            list1.add(item)
        } else {
            list2.add(item)
        }
    }
    return Pair(list1, list2)
}

from kotlin-koans.

akki777-zz avatar akki777-zz commented on June 18, 2024

Bro @jimandreas , you are not reading my posts properly. You are just answering for the sake of it. I wrote And I have not touched this file. in my previous post. The tasks should compile individually. I am working on Lesson 1/Task2.kt, why is it checking Lesson 6/Task1 ?

from kotlin-koans.

jimandreas avatar jimandreas commented on June 18, 2024

Sorry that I cannot help you. Can another reader attempt to provide help to @akki777 ?

from kotlin-koans.

stiofand avatar stiofand commented on June 18, 2024

I have the same issue with all the Koans. I'm trying to get it running on gradle with Java 10, but I'm beginning to suspect this is the issue. Is there anywhere we can see the supported JVM numbers?

from kotlin-koans.

akki777-zz avatar akki777-zz commented on June 18, 2024

I guess no one from the team cares to look into this or other issues. @svtk

from kotlin-koans.

svtk avatar svtk commented on June 18, 2024

Many things here.
About the initial problem with the Edu plugin. I've added a new issue https://youtrack.jetbrains.com/issue/EDU-1500, please provide more details there. That looks like a bug, but we need more details of how exactly to reproduce it (which versions of everything etc).

Another issue with tests: https://youtrack.jetbrains.com/issue/EDU-1005.

About Java versions: should work with all Java versions, but I can't guarantee that's not another bug with Java 10. @stevematdavies, if you could provide more details in the issue, we can check.

Sorry if I missed something. Edu plugin issues should be discussed in the tracker, where the plugin team can check that. So if other problems occur, please provide the details there. Thanks!

from kotlin-koans.

ryanlijianchang avatar ryanlijianchang commented on June 18, 2024

I got this problem also when I work on Lesson 1/Task2.kt, when I click Check, it tips compilation failed.

can anyone help me ? note: I work on android studio V3.4.1, and my PC is windows 7

from kotlin-koans.

xiaowx2010 avatar xiaowx2010 commented on June 18, 2024

I got this problem also when I work on Lesson 1/Task2.kt, when I click Check, it tips compilation failed.

can anyone help me ? note: I work on android studio V3.4.1, and my PC is windows 7

I have the same problem and my Android Studio version is 3.5.1

from kotlin-koans.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.