I'm trying to follow this YouTube tutorial for Android Studio, but when I create my project, I get the following error:
class org.jetbrains.kotlin.idea.core.script.configuration.CompositeScriptConfigurationManager cannot be cast to class org.jetbrains.kotlin.idea.core.script.ScriptConfigurationManager (org.jetbrains.kotlin.idea.core.script.configuration.CompositeScriptConfigurationManager is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @1824eb4b; org.jetbrains.kotlin.idea.core.script.ScriptConfigurationManager is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @61548dd0)
class org.jetbrains.kotlin.idea.core.script.configuration.CompositeScriptConfigurationManager cannot be cast to class org.jetbrains.kotlin.idea.core.script.ScriptConfigurationManager (org.jetbrains.kotlin.idea.core.script.configuration.CompositeScriptConfigurationManager is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @1824eb4b; org.jetbrains.kotlin.idea.core.script.ScriptConfigurationManager is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @61548dd0)
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)
The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
Stop Gradle build processes (requires restart)
Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.
In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.
- AS: 2020.3.1 (renamed version from 4.3)
- OS: Linux (Fedora)
- Gradle: 6.8
At first, it seems very similar to this issue, but the first two lines of my error are different, likely because my AS version is much newer.
I am positive this has nothing to do with a network timeout.
I tried the solutions on the similar issue, deleting my Gradle
wrapper from ~/.gradle/wrapper/dists
and then re-syncing the project. While this removed the error, it failed to generate the app
directory with the initial project files, and I was left with just the configuration files:
Thus, I'm either looking for a different solution to the dependency cache
error, or a fix for the missing project files.
This issue seems to be specific to projects in AS 2020.3.1 that use Kotlin. I could not reproduce with Java projects or AS 4.1.2 (the version used in the tutorial).
Update: Deleting and reinstalling AS 2020.3.1 did not solve the problem, but replacing AS 2020.3.1 with AS 4.1.2 did. Furthermore, after replacing 2020.3.1 with 4.1.2 and then reinstalling 2020.3.1, the project then worked on 2020.3.1. This must be due to a configuration issue with 2020.3.1 that is fixed via the configuration settings of a previous version.