[React Native][0.71] Plugin with id 'com.facebook.react' not found

Plugin with id 'com.facebook.react' not found.

1: Task failed with an exception.

  • Where: Build file 'android/app/build.gradle' line: 2

  • What went wrong: A problem occurred evaluating project ':app'.

Plugin with id 'com.facebook.react' not found.

==============================================================================
* Get more help at
BUILD FAILED in 3s
error Failed to install the app. Make sure you have the Android development environment set up:
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* Where:
Build file 'android/app/build.gradle' line: 2
* What went wrong:
A problem occurred evaluating project ':app'.
> Plugin with id 'com.facebook.react' not found.
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring project ':app'.
> compileSdkVersion is not specified. Please add it to build.gradle
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================
* Get more help at 

2 Answers

Solution

Add classpath("com.facebook.react:react-native-gradle-plugin") in android/build.gradle dependencies

enter image description here

5

I found this docs page useful for this specific issue, but it just led to a new issue... The root of my more general issue was that I was upgrading from a lower version of React Native, and had forgotten to include some of the changes needed. The best way to fix these kinds of issues is to use the React Native Upgrade Helper, which will show you exactly what needs to change using a sample application.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like