can't get intellij to recognize classes from a different gradle subproject
I have a kotlin multi-project set up the way gradle says to do it:
```
project/
├── build.gradle.kts
├── config
│ └── detekt
├── gradle
│ └── wrapper
├── gradlew
├── gradlew.bat
├── jobs
│ ├── build
│ ├── build.gradle.kts
│ └── src
├── lib
│ ├── build
│ ├── build.gradle.kts
│ └── src
```
When I'm working on something in the jobs/ subproject, intellij doesn't recognize any of my classes from lib/. However, everything compiles, tests, and runs fine, so gradle has no issues.
For instance, lib has a package monitor:
```
lib/src/main/
├── kotlin
│ └── com
│ └── company
│ └── group
│ ├── account
│ │ ├── Account.kt
│ │ └── Accounts.kt
```
I import from that account in jobs/
import com.company.group.account.AccountAccessor
but in intellij, `account` is in red and says "unresolved reference
I've tried re-importing the project several times, and it doesn't work.
What am I missing?
Please sign in to leave a comment.
Oh...idea community 2020.2, ubuntu 18.04, gradle, kotlin.
So, can you build project from Build | Rebuild Project action successfully? but editor shows "red" unresolved imports?
How do you configure dependency on modules in Gradle? Is there a project available to check? For uploading you can use ftp://ftp.intellij.net/.uploads / https://uploads.services.jetbrains.com or any file sharing service. Please also include all IDE logs (Help | Collect Logs and Diagnostic Data action).
Yes, the project builds and rebuilds just fine, with the jobs/ subproject using a class from the lib subproject. But intellij shows red unresolved imports.
I have an attempt at a minimal example here. I intentionally left most of the cruft in the dependencies and cruft in build.gradle.kts in case that has something to do with it.
https://github.com/sean-abbott/minimal_kotlin_intellij_example
And here's the logs and whatnot: Upload id: 2020_09_30_7Hj3YVydzstqo2ha (file: idea-logs-20200930-151250.zip) (that's to your upload service)
Thank you for the sample project! Looks like a bug. I have reported in to our issue tracker. Please follow it here for further progress: https://youtrack.jetbrains.com/issue/KT-42378