Failed to apply plugin ‘com.facebook.react.rootproject’

I tried to build development build onto my emulator, yesterday it did fine. But today it got me this error:

  • What went wrong:
    A problem occurred evaluating root project ‘Displio’.

Failed to apply plugin ‘com.facebook.react.rootproject’.
A problem occurred configuring project ‘:app’.
Could not load compiled classes for build file

build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext {
buildToolsVersion = findProperty('android.buildToolsVersion') ?: '34.0.0'
minSdkVersion = Integer.parseInt(findProperty('android.minSdkVersion') ?: '23')
compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '34')
targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '34')
kotlinVersion = findProperty('android.kotlinVersion') ?: '1.8.10'

        ndkVersion = "25.1.8937393"
    }
    repositories {
        mavenCentral()
        google()
    }
    dependencies {
        classpath('com.android.tools.build:gradle')
        classpath('com.facebook.react:react-native-gradle-plugin')
    }

}

apply plugin: "com.facebook.react.rootproject"

allprojects {
repositories {
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url(new File(['node', '--print', "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim(), '../android'))
}
maven {
// Android JSC is installed from npm
url(new File(['node', '--print', "require.resolve('jsc-android/package.json', { paths: [require.resolve('react-native/package.json')] })"].execute(null, rootDir).text.trim(), '../dist'))
}

        google()
        mavenCentral()
        maven { url 'https://jitpack.io' }
    }

}

I tried to basically go through all the gradle files to find what might be causing this error but not any luck