IntelliJ Build Error Context Mismatch

前端 未结 13 1787
梦谈多话
梦谈多话 2020-11-30 07:34

I want to use IntelliJ IDEA 15 instead of Android Studio, but I have a problem with building. I get the following error:

Gradle sync failed: The newly create         


        
相关标签:
13条回答
  • 2020-11-30 07:44

    just move the jdk folder to intellij wanted folder C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2016.3.4\jre

    then change the values in .gradle folder given in wanted line close the project then restart

    it works for me....

    0 讨论(0)
  • 2020-11-30 07:48

    I had the exact same problem and this is what worked for me.

    I deleted the .idea and .project files from the root directory of my IntelliJ project. Restarted IntelliJ and opened my project again.

    0 讨论(0)
  • 2020-11-30 07:49

    If you're using the Gradle IDEA plugin:

    1. Run .\gradlew cleanidea idea
    2. Quit IntelliJ IDEA
    3. Start IntelliJ IDEA and choose the "Import Project" option from the main menu.
    4. Navigate to your project's main build.gradle file when asked to specify the project to import.
    5. You'll then get the chance to set the JDK to "the project default" or another preferred JDK.
    6. Click OK to continue, and watch Gradle sync and build again successfully!
    0 讨论(0)
  • 2020-11-30 07:56

    I solved it by using idea64.exe and not idea.exe

    0 讨论(0)
  • 2020-11-30 07:56

    For me this issue was solved by running IDE in 64 bit mode since I only have 64 bit JRE installed.

    0 讨论(0)
  • 2020-11-30 08:01

    For MacOSX, what solved the problem for me was to point the SDK in IntelliJ to Contents/Home. For example:

    This:

    /Users//.sdkman/candidates/java/14.0.1-zulu/zulu-14.jdk/Contents/Home

    instead of this:

    /Users//.sdkman/candidates/java/14.0.1-zulu

    It is working with the latest, at this time, Java (14.0.1-zulu), Gradle (6.5) and Kotlin (1.4-M2).

    0 讨论(0)
提交回复
热议问题