
Many tutorials mention a class - PsiClass, but I can't find this class in my project. My build.gradle as below:
plugins {
id 'java'
id 'org.jetbrains.intellij' version '0.4.16'
id 'org.jetbrains.kotlin.jvm' version '1.3.61'
id 'idea'
}
apply plugin: "org.jetbrains.intellij"
apply plugin: 'java'
apply plugin: 'idea'
group 'com.github.boybeak.adapter'
version '0.1'
sourceCompatibility = 1.8
repositories {
/*google()
jcenter()*/
mavenCentral()
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
// implementation group: 'com.github.boybeak', name: 'any-adapter', version: '1.1.2'
testCompile group: 'junit', name: 'junit', version: '4.12'
}
intellij {
/*version '192.7142.36'*/
type 'AI'
plugins 'android'
localPath '/Applications/Android Studio.app'
}
My IDEA version:
IntelliJ IDEA 2019.3.1 (Community Edition) Build #IC-193.5662.53, built on December 18, 2019 Runtime version: 11.0.5+10-b520.17 x86_64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o macOS 10.15.3 GC: ParNew, ConcurrentMarkSweep Memory: 990M Cores: 4 Registry: Non-Bundled Plugins: DBN, OdpsStudio, no.tornado.tornadofx.idea
Should I add some more libraries in my project?
After a little more searching, I find a solution. https://intellij-support.jetbrains.com/hc/en-us/community/posts/360005055559-Missing-classes-after-upgrade-to-2019-2-2
Change my Gradle like this:
intellij {
/*version '192.7142.36'*/
type 'AI'
plugins 'android', 'java'
localPath '/Applications/Android Studio.app'
}
Add Java plugin after android
I was able to fix this by adding this to the build.gradle.kts file:
intellij {
version.set("2021.3.3")
type.set("IC") // Target IDE Platform
plugins.set(listOf("com.intellij.java")) // Add this
}
When I did that, this little guy popped up:

I clicked on that and then I was able to import the PsiClass.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With