kotlin-gradle plugin auto configure error - gradle

Module build.gradle code and file structure
Project build.gradle and buildscript code, and reported error
Just getting started with kotlin for android development here. After converting MainActivity to .kt, the kotlin-gradle plugin needs to be configured. IntelliJ offers to do it automatically, but fails with the error:
Cannot find build.gradle for module app.
I know I can configure it myself, but why cant intelliJ find the build.gradle files, they are in the project that was automatically generated by intelliJ itself. Do I have something configured incorrectly?
Any help or insight is appreciated, thank you in advance.

Seems that you are using Idea 2016.1. There is a bug in your tracker: https://youtrack.jetbrains.com/issue/KT-11593

Download the Maven repo from SDK manager, then try to reconfigure the kotlin again.

Related

does not contain a Gradle build?

'C:\Users\Dell\Downloads\StolenCarsReporting' does not contain a Gradle build.
I am getting this error Please help! I am new to android?
I tried closing/reopening project, importing project instead of opening, but did not worked!
Please guide me I am pretty new to android.

Unresolved reference JavaVersion in gradle buildSrc IntelliJ

I am facing a problem with two existing gradle projects that worked fine a couple of months ago but that show now an annoying error in the buildSrc folder, where I use the org.gradle.api.JavaVersion constant.
The project compiles correctly and is imported to IntelliJ. I can also run it so I guess everything is working but of course I don't like to get an error thrown into my face ;)
Here are both example projects:
https://github.com/Quillraven/Quilly-s-Adventure
https://github.com/Quillraven/Dark-Matter
They are both a multi-project with a core, desktop and android project.
In both projects I use a buildSrc folder to define the versions in a common place for the entire project.
For whatever reason, IntelliJ is now showing an error "unresolved reference JavaVersion" in the Dependencies.kt/versions.kt file.
The build.gradle.kts of the buildSrc folder looks like this:
plugins {
`kotlin-dsl`
}
repositories {
jcenter()
}
Does anyone know how to get rid of this error? Is it an IntelliJ issue or something else? Or is the issue on my end ?
This is an Intellij IDEA 2020.2 bug: https://youtrack.jetbrains.com/issue/KT-40683. Dependencies are unresolved in the buildSrc module, when you also have an Android module in the project.
As a possible workaround, please use IDEA 2020.1.

Gradle composite build with custom gradle plugin fails in IntelliJ: "Could not find method api() for arguments"

I have a Gradle composite build project which contains a custom Gradle plugin. This project builds fine when using Gradle CLI, but IntelliJ fails.
I tried a few different variations on the plugin version within the resolutionStrategy block: org.test:test-plugin:0.0.1 and test-plugin:test-plugin.gradle.plugin:0.0.1 as described here: https://docs.gradle.org/current/userguide/plugins.html#sec:plugin_markers - both of those work from the CLI; changing to invalid values ("blah:blah") causes a failure.
I've made a sample Github project that contains the code to reproduce, here: https://github.com/mwmitchell/intellij-gradle-plugin-composite-build-bug along with instructions to reproduce and a workaround. The workaround is something that's not really feasible for me, as it requires repeating configuration code (dependencies, plugins etc.) and I have many, many projects that require the same/common configuration.
I would expect IntelliJ to load the project successfully, just like the CLI does. It seems like IntelliJ is loading the sub-project (:project-1:library-a) before the parent (:project-1), such that the java-library is not actually applied to the sub-project when it's evaluated.
Thanks for the sample project! Indeed, it is an issue in IntelliJ IDEA, see this ticket.
Gradle projects can have only one settings.gradle. You can include subproject "library-a" with include 'project-1:library-a' in the main settings.gradle.

To add gradle Task for Serenity-JS for typescript

How to add a gradle task in build.gradle for serenity-js project?
Please pointers to reference where we can get the sample implementation.
I've never heard of serenity-js but it seems to be a nodejs plugin. I'm guessing you could invoke this via gradle-node-plugin

Error: Spring Application Cannot be resolved

I trying to create Gradle project to use with spring Boot in Eclipse in my organization network. But I am not able to create it It's giving me an error
"Exception in thread "main" java.lang.Error: Unresolved compilation problem:
SpringApplication cannot be resolved at com.vidya.BootGradleApplication.main(BootGradleApplication.java:11)"
Please help me to solve this problem. I have attached the Image for more understanding
For anyone else with this problem, here's something important that may help you.
"Eclipse does not automatically update the classpath, if the build.gradle file is updated. Select Gradle ▸ Refresh Gradle Project from the context menu of the project or from your build.gradle file for that"
From http://www.vogella.com/tutorials/EclipseGradle/article.html#updating-classpath-with-the-latest-changes-in-the-build-file
I am using Vscode and this problem wasted me for an hour.
The way to solve this bug in Vscode is just to restart Vscode so that it can update the project

Resources