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

Build error in hello-kapt sample #1392

Closed
IgorGanapolsky opened this issue Oct 14, 2019 · 3 comments
Closed

Build error in hello-kapt sample #1392

IgorGanapolsky opened this issue Oct 14, 2019 · 3 comments

Comments

@IgorGanapolsky
Copy link

Expected Behavior

Project should build in IntelliJ IDE without errrors/warnings.

Make project compatible with IntelliJ IDE

Current Behavior

See screenshot. There is a build warning (Type mismatch) in the application { } block in build.gradle.kts

Make this warning go away.

Context

Cannot build the sample

Steps to Reproduce (for bugs)

https://gradle.com/s/55hnsqk5xenlu

a) Open project in IntelliJ IDEA
b) View build.gradle.kts file

Your Environment

IntelliJ IDEA 2019.3 EAP (Ultimate Edition)
Build #IU-193.4386.10, built on October 8, 2019
IntelliJ IDEA EAP User
Expiration date: November 7, 2019
Runtime version: 11.0.4+10-b517.1 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.15
GC: ParNew, ConcurrentMarkSweep
Memory: 1979M
Cores: 16
Screen Shot 2019-10-14 at 11 40 29 AM

  • Build scan URL: https://gradle.com/s/55hnsqk5xenlu
  • gradle --version 5.4
  • Version of IntelliJ or Android Studio (in About menu you can copy version information)
  • Version of the Kotlin Plugin used in IntelliJ or Android Studio (in the Configure Kotlin Plugin Updates preference panel)
@StefMa
Copy link
Contributor

StefMa commented Oct 14, 2019 via email

@IgorGanapolsky
Copy link
Author

IgorGanapolsky commented Oct 14, 2019

There is no such option

apply new context

see full screenshot:
Screen Shot 2019-10-14 at 1 33 38 PM

@eskatos
Copy link
Member

eskatos commented Nov 6, 2019

Thanks for the report @IgorGanapolsky. As @StefMa said, this is a IDE problem. It is due to a mismatch in IntelliJ setup between the JDK used for Gradle and the JDK used for the project sources. The script editor can't find java.lang.String!

This is gradle/gradle#9195

Using the same Java version for Gradle in IntelliJ and your Project SDK in IntelliJ will fix this.
If you can't use the same Java version for Gradle in IntelliJ and your Project SDK in IntelliJ then you'll need to be using Gradle >=6.0 and the Kotlin IntelliJ Plugin >= 1.3.50.

Closing, please reopen if the problem persists after applying the above.

@eskatos eskatos closed this as completed Nov 6, 2019
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

3 participants