I’m trying to update gradle in my expo react native app and to do so I executed "./gradlew wrapper –gradle-version 8.9" in the android level. But when I see the logs of the update, it appears this erros:
> Configure project :gradle-plugin
e: file:///home/enzo/Desktop/Projetos/React-Native/BarON/node_modules/@react-native/gradle-plugin/build.gradle.kts:10:49: Unresolved reference: serviceOf
e: file:///home/enzo/Desktop/Projetos/React-Native/BarON/node_modules/@react-native/gradle-plugin/build.gradle.kts:54:11: Unresolved reference: serviceOf
FAILURE: Build failed with an exception.
* Where:
Build file '/home/enzo/Desktop/Projetos/React-Native/BarON/node_modules/@react-native/gradle-plugin/build.gradle.kts' line: 10
* What went wrong:
Script compilation errors:
Line 10: import org.gradle.configurationcache.extensions.serviceOf
^ Unresolved reference: serviceOf
Line 54: serviceOf<ModuleRegistry>()
^ Unresolved reference: serviceOf
2 errors
I tried to edit the classpath on the dependencies in thebuild.gradle
file and the distributionUrl on the gradle-wrapper.properties
file but the errors continues. I also tried to update the react native plugin (npm update react-native
) and the expo(npm update expo
) and it’s already up to date. I can’t use any gradle command because if I do returns the same error.
Here’s some useful information:
gradle-wrapper.properties
distributionUrl=https://services.gradle.org/distributions/gradle-8.9-all.zip
build.gradle on the app level
dependencies {
classpath('com.android.tools.build:gradle:8.5')
classpath('com.facebook.react:react-native-gradle-
}
2
Answers
Just downgrade gradle-8.9-all to gradle-8.8-all
I’m facing the same issue. Did you find a solution?