Error resolving plugin [id: 'com.facebook.react.settings']
Problem
Minimal reproducible example https://github.com/BraveEvidence/SampleExpo What platform(s) does this occur on? Android Where did you reproduce the issue? in a development build Summary I created a simple Expo Project using `npx create-expo-app@latest --template blank-typescript`, I need to write native android code so I did following `npx expo install expo-dev-client` `npx expo run:android` `npx create-expo-module@latest --local` I have the necessary Android Setup on my Mac like Android Studio, Java etc When I open the android folder in Android Studio I get following error during gradle sync. I have not written a single line of code [code block] Environment [code block] Expo Doctor Diagnostics [code block]
Error Output
error during gradle sync. I have not written a single line of code
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Fix Gradle Sync Error for React Native Plugin
The error occurs due to the absence of the required React Native plugin 'com.facebook.react.settings' in the Gradle build configuration. This can happen if the plugin is not included in the build.gradle file or if there are version mismatches between the Expo SDK and the React Native dependencies.
Awaiting Verification
Be the first to verify this fix
- 1
Update build.gradle File
Open the android/build.gradle file and ensure that the React Native plugin is included in the buildscript dependencies. Add the following line to the dependencies section if it's missing.
groovyclasspath 'com.facebook.react:react-native-gradle-plugin:0.71.0' - 2
Check React Native Version
Ensure that the version of React Native specified in your project matches the version of the Expo SDK you are using. You can check the compatible versions in the Expo documentation.
bashexpo --version - 3
Sync Gradle
After making the changes, sync your Gradle files in Android Studio. This can be done by clicking on 'Sync Now' when prompted or selecting 'File' -> 'Sync Project with Gradle Files'.
- 4
Clean and Rebuild Project
If the issue persists, try cleaning and rebuilding the project. In Android Studio, select 'Build' -> 'Clean Project' followed by 'Build' -> 'Rebuild Project'. This can resolve lingering issues from previous builds.
Validation
To confirm the fix worked, re-open the android folder in Android Studio and check if the Gradle sync completes successfully without errors. Additionally, run the project using 'npx expo run:android' and ensure it builds and runs on an emulator or device.
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep