I’m working on a React Native project, and I’ve been encountering issues while building my Android app. I’ve followed various upgrade steps and adjustments, but I can’t seem to resolve the following error:
Error
When running the command:
npx react-native run-android
I get the following build error:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'AppBarFrontend'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not find com.facebook.react:react-native-gradle-plugin:.
Required by:
root project :
> Could not find org.jetbrains.kotlin:kotlin-gradle-plugin:.
Required by:
root project :
1. Checked my build.gradle file: I have defined the appropriate versions for Gradle, React Native, and Kotlin. Here is my build.gradle file:
buildscript {
ext {
buildToolsVersion = "35.0.0"
minSdkVersion = 24
compileSdkVersion = 35
targetSdkVersion = 34
ndkVersion = "26.1.10909125"
kotlinVersion = "1.9.24"
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:8.0.2")
classpath("com.facebook.react:react-native-gradle-plugin:0.75.3")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
2. Cleaned and reinstalled dependencies:
I ran
./gradlew clean and npm install
but I still get the same error.
3. React Native Version:
I’m using React Native 0.75.3 and have
react-native-community/cli
set to version 14.1.0.
Additional Configuration:
I’m working in a Windows environment using VS Code.
My gradle-wrapper.properties file has the following configuration:
distributionUrl=https://services.gradle.org/distributions/gradle-8.10-all.zip
Why are com.facebook.react:react-native-gradle-plugin and kotlin-gradle-plugin not being found, despite being correctly specified in the build.gradle file? Is it possible that I’m missing a repository configuration or there is a version conflict somewhere?
I’d really appreciate any help or suggestions on how to resolve this issue. Thank you in advance!
7