Open chanjeff2 opened 2 years ago
Thanks for sharing your solutions. However, there are really only 2 things that you need to do:
Check whether your project's Gradle is linked.
Go to settings.gradle.kts
, and there is a blue bar saying "Code insight unavailable (related Gradle project not linked)", click on "Link Gradle Project" at the other side of the bar.
Press "Trust Project" if it prompts whether you want to trust the Gradle project.
Reload the Gradle project.
Go to the Gradle panel (either at your right hand side, or View > Tool Windows > Gradle
), and click the refresh button (top-left corner of the panel, looks like a reload button).
After that, your project should be successfully linked to Gradle.
You may also check whether the Gradle settings of IntelliJ is configured properly by going to File > Settings
and navigating to Build, Execution, Deployment > Build Tools > Gradle
and check the following items:
if there is any better solution, please let me know
1. classnotfoundexception/cannot find declaration to go to
mark
.../src/main/java
as Sources Root2. Gradle not linked to project/cannot resolve org.jetbrains.annotations
click "Load Script Configuration" (or whatever there) on the blue alert message "bar".
if there are multiple "bars", just click them all.
3. output path not specified
goto File/Project Structure
.../app/build
(if it used to be empty)Module not specified/"cross" on Main
open "Edit Configuration"
set "Use Classpath of module" to
...app.main