I'm developing a IDEA-Plugin. But after updating Intellij IDEA, the ide always show the warning that leading to the failure of code completion:
Cannot access class 'com.intellij.psi.PsiElement'. Check your module classpath for missing or conflicting dependencies
I have tried to upgrade gradle plugin or dependencies version, unfortunately it not work.
My build.gradle
script at root project directory:
plugins {
id 'org.jetbrains.intellij' version '1.1.6'
id "org.jetbrains.kotlin.jvm" version '1.5.21'
}
group 'org.example'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.5.21'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.2'
}
intellij {
version '2021.2'
plugins = ['java','Kotlin']
}
patchPluginXml {
changeNotes.set(
"""
Add change notes here.<br>
<em>most HTML tags may be used</em>
"""
)
}
test {
useJUnitPlatform()
}
My plugin.xml
file:
<idea-plugin>
<id>org.example.TestPlugin</id>
<name>Plugin display name here</name>
<vendor email="[email protected]" url="http://www.yourcompany.com">YourCompany</vendor>
<description><![CDATA[
Enter short description for your plugin here.<br>
<em>most HTML tags may be used</em>
]]></description>
<!-- please see https://plugins.jetbrains.com/docs/intellij/plugin-compatibility.html
on how to target different products -->
<depends>com.intellij.modules.platform</depends>
<depends>org.jetbrains.kotlin</depends>
<extensions defaultExtensionNs="com.intellij">
<!-- Add your extensions here -->
</extensions>
<actions>
<!-- Add your actions here -->
<action id="TestAction" class="org.example.TestAction" text="TestAction" description="TestAction">
<add-to-group group-id="GenerateGroup" anchor="last"/>
</action>
</actions>
</idea-plugin>
What's wrong with my Project? Thanks for your answer!
CodePudding user response:
Since the IntelliJ SDK 2020.3
, you're supposed to use Java 11, not 8.
Ref: https://blog.jetbrains.com/platform/2020/09/intellij-project-migrates-to-java-11/