svtk / AtomicKotlinCourse

87 stars 21 forks source link

Gradle build fail problem #64

Open davyzhu opened 3 years ago

davyzhu commented 3 years ago

Hi, I tried to do AtomicKotlin exercises by EduTools plugin. But after open the project, Gradle build failed. In Gradle settings, Gradle JVM is set to #JAVA_INTERNAL[Invalid] Any suggestion, thanks!

Build file 'C:\Users\zhu_s\IdeaProjects\AtomicKotlin\build.gradle' line: 28 A problem occurred evaluating root project 'AtomicKotlinCourse'.

Could not find method compile() for arguments [org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.20] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

image

image

image

imsyf commented 3 years ago

@davyzhu I managed to get it working by just simply replacing the build.gradle file in the root directory of AtomicKotlin project on my local storage with the build.gradle file from this repository.

I think the older build script is incompatible with newer version of Gradle.

davyzhu commented 3 years ago

@imsyf Thank you! https://github.com/svtk/AtomicKotlinCourse/pull/52

@davyzhu I managed to get it working by just simply replacing the build.gradle file in the root directory of AtomicKotlin project on my local storage with the build.gradle file from this repository.

I think the older build script is incompatible with newer version of Gradle.

jamesward commented 3 years ago

Where'd you get the sources from?

agaltsoff commented 3 years ago

I encountered the same problem after installing IntelliJ IDEA Community Edition and Atomic Kotlin course via Edu Tools plugin from scratch on Win10 x64 box.

Something from this list helped me:

  1. Changing JDK 17 for JDK 16 since IDE annotations were from v16 and I didn't manage to find v17 annotations quickly.
  2. Setting Gradle JVM to version 16 since it was invalid just as topic starter said.
  3. Setting ext.kotlin_version in build.gradle from '1.5.20' to '1.5.10' since this version came with Kotlin plugin and this line produced a warning Kotlin version that is used for building with Gradle (1.5.20) differs from the one bundled into the IDE plugin (1.5.10)

I think the last change made the final trick because after loading Gradle changes the whole bunch of stuff came in and though one build.gradle line still caused two errors

Cannot resolve symbol 'TestDescriptor'
Cannot resolve symbol 'TestResult'

it didn't prevent successfull build.

BruceEckel commented 3 years ago

I encountered this issue with a different Gradle project -- some versions of Gradle break with newer versions of Java.

Bruce Eckel SummerTechForum.com MindViewLLC.com Blog: BruceEckel.com EvolveWork.co WinterTechForum.com http://www.WinterTechForum.com OnJava8.com http://www.OnJava8.com www.AtomicKotlin.com Reinventing-Business.com http://www.Reinventing-Business.com

On Sun, Sep 19, 2021 at 5:46 AM Mikhail Agaltsoff @.***> wrote:

I encountered the same problem after installing IntelliJ IDEA Community Edition and Atomic Kotlin course via Edu Tools plugin from scratch on Win10 x64 box.

Something from this list helped me:

  1. Changing JDK 17 for JDK 16 since IDE annotations were from v16 and I didn't manage to find v17 annotations quickly.
  2. Setting Gradle JVM to version 16 since it was invalid just as topic starter said.
  3. Setting ext.kotlin_version in build.gradle from '1.5.20' to '1.5.10' since this version came with Kotlin plugin and this line produced a warning Kotlin version that is used for building with Gradle (1.5.20) differs from the one bundled into the IDE plugin (1.5.10)

I think the last change made the final trick because after loading Gradle changes the whole bunch of stuff came and though one build.gradle line still contained two errors

Cannot resolve symbol 'TestDescriptor' Cannot resolve symbol 'TestResult'

this didn't prevent successfull build.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/svtk/AtomicKotlinCourse/issues/64#issuecomment-922460498, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHUTLHRF2NKXUH7AN4LQNDUCXERHANCNFSM5CAGY4QA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

agaltsoff commented 3 years ago

All errors vanished after updating Kotlin to the latest version 1.5.31 and setting ext.kotlin_version back to 1.5.20. Honestly to update Kotlin was my first intent but I was somehow mislead by "bundled into the IDE plugin" in warning text. So I was looking for Kotlin in plugin settings instead of File - Settings - Languages & Frameworks.

I encountered the same problem after installing IntelliJ IDEA Community Edition and Atomic Kotlin course via Edu Tools plugin from scratch on Win10 x64 box.

Something from this list helped me:

1. Changing JDK 17 for JDK 16 since IDE annotations were from v16 and I didn't manage to find v17 annotations quickly.

2. Setting Gradle JVM to version 16 since it was invalid just as topic starter said.

3. Setting ext.kotlin_version in build.gradle from '1.5.20' to '1.5.10' since this version came with Kotlin plugin and this line produced a warning `Kotlin version that is used for building with Gradle (1.5.20) differs from the one bundled into the IDE plugin (1.5.10) `

I think the last change made the final trick because after loading Gradle changes the whole bunch of stuff came in and though one build.gradle line still caused two errors

Cannot resolve symbol 'TestDescriptor'
Cannot resolve symbol 'TestResult'

it didn't prevent successful build.

EmperorKonstantin commented 5 months ago

AtomicKotlin exercises in the EduTools plugin are still broken, however opening this repo the [Check] button works just fine. However, all of the problem sets have their answers in them. How do you compile/build this course and open it properly in EduTools as a course instead of a project?