e: /node_modules/@react-native/gradle-plugin/build.gradle.kts:10:49: Cannot access ‘serviceOf’: it is internal in ‘org.gradle.configurationcache.extensions’
e: /node_modules/@react-native/gradle-plugin/build.gradle.kts:45:11: Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
internal inline fun TaskInternal.serviceOf(): TypeVariable(T) defined in org.gradle.configurationcache.extensions
Build file ‘/node_modules/@react-native/gradle-plugin/build.gradle.kts’ line: 10
Script compilation errors:
-
Try:
Run with –info or –debug option to get more log output. Run with –scan to get full insights. -
Exception is:
ScriptCompilationException(errors=[ScriptCompilationError(message=Cannot access ‘serviceOf’: it is internal in ‘org.gradle.configurationcache.extensions’, location=/private/var/folders/mt/lt1qt3y93g9gfsyl2vg6qkq00000gn/T/gradle-kotlin-dsl-10130061735515911946.tmp/build.gradle.kts (10:49)), ScriptCompilationError(message=Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
internal inline fun TaskInternal.serviceOf(): TypeVariable(T) defined in org.gradle.configurationcache.extensions, location=/private/var/folders/mt/lt1qt3y93g9gfsyl2vg6qkq00000gn/T/gradle-kotlin-dsl-10130061735515911946.tmp/build.gradle.kts (45:11))])
react-native 0.72.5
gradle 8.0.1
node V20
jdk 11
2
Answers
Same problem here! I already try remove the import org.gradle.configurationcache.extensions.serviceOf, but doesn’t work!
I encountered the same issue having:
and I get in my project with command
this error:
even in this issue on GitHub (
https://github.com/facebook/react-native/issues/32858
) , they said it was resolved just changing version of Gradle but I just found it happens even with latest Gradle, 8.10.