Search code examples
android-studio

the new version of Android studio does not run the project that was running in the old version


I updated Android Studio and now the project that worked well in the old Studio is not going to fail.:

Unable to find method ''org.jetbrains.kotlin.buildtools.api.SourcesChanges org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile.getChangedFiles$default(org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile, org.gradle.work.InputChanges, java.util.List, kotlin.jvm.functions.Function1, int, java.lang.Object)'' 'org.jetbrains.kotlin.buildtools.api.SourcesChanges org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile.getChangedFiles$default(org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile, org.gradle.work.InputChanges, java.util.List, kotlin.jvm.functions.Function1, int, java.lang.Object)'

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.

You can click on: Re-download dependencies and sync project (requires network) and Stop Gradle build processes (requires restart) Does not help, what can it be and how to solve it?


Solution

  • the Android Gradle plugin might get updated when you update android studio so it might be not compatible with your kotlin version.

    take a look at kotlin multiplatform compatibility guide

    and try to downgrade the agp version to the old one or upgrade the kotlin version maybe.

    take a look also at this it might be helpful Unable to find method ''java.io.File > org.jetbrains.kotlin.gradle.tasks.KotlinCompile.getDestinationDir()