9

I'm trying to follow the Kotlin Koans tutorial in Android Studio by installing the EduTools plugin and choosing Kotlin Koans course.

Everything works fine, but when I try "Check Task" in the Task Description panel, I get this error:

Failed to launch checking

I also tried the plugin with Intellij IDEA and got the same error.

Using:

  • Android Studio 3.2 with EduTools 2.0-2018.1-443
  • Intellij IDEA 2018.2.3 with EduTools 2.0-2018.2-906
lcnicolau
  • 2,520
  • 4
  • 30
  • 48

6 Answers6

2

I found the problem in IDE logs as @NullReference suggested.

INFO - ecker.gradle.GradleCommandLine - Failed to launch checking 
Cannot run program "./gradlew" (...) No such file or directory

I had configured the project (Settings / Build, Execution, Deployment / Build Tools / Gradle) to use a local Gradle distribution and it seems that EduTools plugin always looks for the Gradle Wrapper, so I just had to generate a Wrapper for project and configure it to use my local Gradle distribution:

gradle wrapper --gradle-distribution-url file:///path/to/local/gradle-4.6-all.zip
lcnicolau
  • 2,520
  • 4
  • 30
  • 48
  • hi Nicolau, I know nothing about Gradle, so How should I exactly to config gradle? where to execute the above gradle command? Thank you – Swing Feb 12 '19 at 12:26
  • @Swing: I only had this problem because I wanted to use a local Gradle distribution, but If you have an Internet connection without restrictions, Android Studio will automatically download the appropriate Gradle distribution and configure the wrapper for you. However, if you are in my same situation, you must execute the above command in the root directory of the project. You can take a look [here](https://docs.gradle.org/current/userguide/getting_started.html) and [here](https://developer.android.com/studio/build/) to familiarize yourself with Gradle. – lcnicolau Feb 13 '19 at 21:16
1

Maybe could try IntelliJ Idea Edu which comes already bundled with EduTools.

  • Once you've downloaded and installed the application click "Learn" in the welcome screen and choose "Kotlin Koans" from the "Select Course" dialogue. –  Oct 09 '18 at 22:17
  • Thanks @NullReference. It seems a good option, but I have a limited Internet connection and I can't download it. I need to fix this issue. – lcnicolau Oct 10 '18 at 02:08
  • 1
    I see. Could you maybe try it again and paste in the logs? _Help_ **>** _Show Log in Explorer/Finder_ –  Oct 10 '18 at 07:03
0

I also got this issue. Finally, I 've resolved it by configuring my gradle bin to PATH.

Here are series of commands to configure Gradle into you Path.

# cd ~
# touch .bash_profile  
# open -e .bash_profile 

//to edit your bash_profile ,you need to input your local path to bash_profile,like this:

export GRADLE_HOME=/Users/PCNAME/.gradle/wrapper/dists/gradle-4.5-bin/bgd6nrwgxy3inh8yed6gmsvbx/gradle-4.5/ --- use your own grade path to replace them.

export PATH=${PATH}:${GRADLE_HOME}/bin

# source .bash_profile
# gradle -v //  you will see your gradle version if your configure successfully.

Restart Android Studio, try to run your EDUTOOLS.

0

I received the same error. I closed Android Studio and created a new Koans project thinking I must have done something wrong. This time I received a new build time error when trying to "Check". None of this made sense so I just shut down Android Studio, reopened the Koans project I just created and clicked "Check". Everything seemed to work now.

tommyboy
  • 716
  • 5
  • 11
0

Had the same problem. Just Sharing how I fixed this problem.

  • I opened build.gradle of my Kotlin Koans Project and scrolled down to where wrapper was defined.
  • Pressed play icon right next to it.
  • Was greeted with an error
    Error:Failed to open zip file. Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.) Re-download dependencies and sync project (requires network) Re-download dependencies and sync project (requires network)
  • Followed Answer by Hamid

To resolve this issue close Android Studio and delete the following directory's content, necessary files will be downloaded on IDE's next launch.

macOS: ~/.gradle/wrapper/dists

Linux: ~/.gradle/wrapper/dists

Windows: C:\Users\your-username.gradle\wrapper\dists

  • Restarted Android Studio and it worked like a charm.
0

In my case I had a problem related to JDK 11 and I had JDK 8 installed. This is how I fixed the problem:

Go to Settings / Build, Execution, Deployment / Build Tools / Gradle. At Gradle JVM select JDK 11 path.

It worked for me.