I have a multi module Android Compose project. One module is an android app, others are android libraries or kotlin libraries. I'm running AS Artic Fox 2020.3.1 Beta 5 on MacOS 11.4 Big Sur.
After a library upgrade (probably AGP to use compose, I don't remember when exactly) Android Studio started to show syntax errors everywhere, both in .kts and .kt files.
Compilation and execution are working fine, only those weird JDK errors are displayed.
Here are some examples : in a .kt file from a kotlin library module, in a .kts file from the buildSrc module
It seems that there is an error with the JDK somewhere, but I don't understand how to fix it.
I Googled/StackOverflowed before posting here and I already tried :
- to check the JDK used Project Structure > SDK Location > Gradle. It is using the Embedded JDK 11.0.10
- to reinstall AS using Jetbrains Toolbox
- to invalidate cache and restart
- to clone my project again
- to delete ~/.gradle
But none of those actions helped...
Thanks in advance !
Update 22/07
- I tried to create a new empty Compose project with .kts support, but no luck, everything is in red
- Because of a bug preventing to update, I updated manually to RC_1. Here is my current setup.
- I tried to change from Embedded JDK to a separately installed OpenJDK 11 and reimport but not luck (@alexey-belkov suggestion)
- I checked the logs but found nothing obvious (@andy suggestion)
- ℹ️ Finally I tried to create a new empty Android project with only .gradle support, and no errors ! Could it be a kotlin script plugin problem ?