Skip to content
This repository has been archived by the owner on Aug 5, 2021. It is now read-only.

Compilation Failed #150

Open
akki777-zz opened this issue May 4, 2018 · 15 comments
Open

Compilation Failed #150

akki777-zz opened this issue May 4, 2018 · 15 comments

Comments

@akki777-zz
Copy link

akki777-zz commented May 4, 2018

I am using Edu Tools - Kotlin Koans to learn Kotlin. The Compare with Answer in the Task Description window shows "Contents are identical". Still when I "Check Task" in the Task Description window, I get Compilation Failed.

This is happening in IntelliJ 2017.3.4 as well as Android Studio 3.1.2 .
The "Lesson 1 - Task 1 (hello World.kt)" works fine. but afterwards this issue occurs.
It says I have issues in other lessons like "Generics Task 1" and in tests file also.

@jimandreas
Copy link

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!!

@akki777-zz
Copy link
Author

akki777-zz commented May 6, 2018

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

@jimandreas
Copy link

jimandreas commented May 7, 2018

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.

@akki777-zz
Copy link
Author

akki777-zz commented May 8, 2018

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

@jimandreas
Copy link

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.

@akki777-zz
Copy link
Author

akki777-zz commented May 8, 2018

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

@jimandreas
Copy link

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)
}

@akki777-zz
Copy link
Author

akki777-zz commented May 9, 2018

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 ?

@jimandreas
Copy link

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

@stiofand
Copy link

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?

@akki777-zz
Copy link
Author

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

@svtk
Copy link
Contributor

svtk commented Jun 4, 2018

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!

@ryanlijianchang
Copy link

ryanlijianchang commented Jun 14, 2019

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

@xiaowx2010
Copy link

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

@mictaege
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants