isHermesEnabled overrides nothing in Kotlin

321 Views Asked by At

My project is using React 18 and Kotlin. The MainAplication.kt is returning an error that says:

'isHermesEnabled' overrides nothing

This is the Main Application file:

    class MainApplication : Application(), ReactApplication {

    private val mReactNativeHost: ReactNativeHost = object : 
        DefaultReactNativeHost(this) {
    override fun getUseDeveloperSupport(): Boolean {
        return BuildConfig.DEBUG
    }

    override protected fun getPackages(): ArrayList<ReactPackage?> {
        @SuppressWarnings("UnnecessaryLocalVariable")
        val packages: ArrayList<ReactPackage?> = PackageList(this).getPackages()

        return packages
    }

    override fun getJSMainModuleName(): String {
        return "index.android"
    }

    override protected fun getJSBundleFile(): String? {
        return if (BuildConfig.DEBUG) {
            super.getJSBundleFile()
        } else CodePush.getJSBundleFile()
    }

    override protected fun getJSIModulePackage(): JSIModulePackage? {
        return ReanimatedJSIModulePackage()
    }

    override protected fun isNewArchEnabled(): Boolean {
      return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
    }

    override protected fun isHermesEnabled(): Boolean {
      return BuildConfig.IS_HERMES_ENABLED
    }
}

I tried the solutions from kotlin onCreate overrides nothing, but they did not work for me

I have the hermes variable set true in build.gradle

project.ext.react = [
enableHermes: true ]

and gradle.properties

hermesEnabled=true

What could I try next?

0

There are 0 best solutions below