facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
119.26k stars 24.35k forks source link

Error resolving plugin [id: 'com.facebook.react.settings'] on 0.76 react native version after Reanimated, React Navigation, and other pacakges installed #47225

Closed maheshmuttintidev closed 2 weeks ago

maheshmuttintidev commented 2 weeks ago

Description

i was getting the below error after i installed below packages, i don't understand which package has issue with the latest react native version 0.76

 "dependencies": {
    "@react-navigation/bottom-tabs": "^6.6.1",
    "@react-navigation/drawer": "^6.7.2",
    "@react-navigation/native": "^6.1.18",
    "@react-navigation/stack": "^6.4.1",
    "@rneui/base": "4.0.0-rc.8",
    "@rneui/themed": "4.0.0-rc.8",
    "react": "18.3.1",
    "react-native": "0.76.0",
    "react-native-animatable": "^1.4.0",
    "react-native-autocomplete-dropdown": "^4.0.0",
    "react-native-bootsplash": "^6.2.3",
    "react-native-document-picker": "^9.3.1",
    "react-native-elements": "^3.4.3",
    "react-native-gesture-handler": "^2.20.2",
    "react-native-image-picker": "^7.1.2",
    "react-native-otp-entry": "^1.7.2",
    "react-native-permissions": "^5.0.2",
    "react-native-reanimated": "^3.16.1",
    "react-native-safe-area-context": "^4.12.0",
    "react-native-screens": "^3.35.0",
    "react-native-svg": "^15.8.0",
    "react-native-vector-icons": "^10.2.0",
    "react-native-vision-camera": "^4.5.3",
    "vision-camera-qrcode-scanner": "^0.1.4"
  },

please help me to resolve this issue

* What went wrong:
Error resolving plugin [id: 'com.facebook.react.settings']
> Included build '/Users/maheshmuttinti/Documents/abcdef/driver/node_modules/@react-native/gradle-plugin' does not exist.

* 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 https://help.gradle.org.

BUILD FAILED in 395ms
error Failed to install the app. Command failed with exit code 1: ./gradlew app:installDebug -PreactNativeDevServerPort=8081 -PreactNativeArchitectures=arm64-v8a FAILURE: Build failed with an exception. * Where:
Settings file '/Users/maheshmuttinti/Documents/abcdef/driver/android/settings.gradle' line: 2 * What went wrong:
Error resolving plugin [id: 'com.facebook.react.settings']
> Included build '/Users/maheshmuttinti/Documents/abcdef/driver/node_modules/@react-native/gradle-plugin' does not exist. * 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 https://help.gradle.org. BUILD FAILED in 395ms.
info Run CLI with --verbose flag for more details.
 ELIFECYCLE  Command failed with exit code 1.
 ELIFECYCLE  Command failed with exit code 1.

Steps to reproduce

  1. install @react-navigation/native, @react-navigation/drawer, @react-navigation/bottom-tabs, @react-navigation/stack, react-native-safe-area-context, react-native-reanimated packages
  2. Run npm android to reproduce this error

React Native Version

0.76.0

Affected Platforms

Runtime - Android

Areas

Bridgeless - The New Initialization Flow, Codegen, Other (please specify)

Output of npx react-native info

System:
  OS: macOS 15.0.1
  CPU: (8) arm64 Apple M2
  Memory: 78.25 MB / 8.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.20.4
    path: ~/.nvm/versions/node/v18.20.4/bin/node
  Yarn:
    version: 1.22.22
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.7.0
    path: ~/.nvm/versions/node/v18.20.4/bin/npm
  Watchman:
    version: 2024.10.21.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods: Not Found
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.0
      - iOS 18.0
      - macOS 15.0
      - tvOS 18.0
      - visionOS 2.0
      - watchOS 11.0
  Android SDK: Not Found
IDEs:
  Android Studio: 2024.2 AI-242.23339.11.2421.12483815
  Xcode:
    version: 16.0/16A242d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.13
    path: /Users/maheshmuttinti/.jenv/shims/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 15.0.0-alpha.2
    wanted: 15.0.0-alpha.2
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.76.0
    wanted: 0.76.0
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: Not found
  newArchEnabled: false

Stacktrace or Logs

* What went wrong:
Error resolving plugin [id: 'com.facebook.react.settings']
> Included build '/Users/maheshmuttinti/Documents/abcdef/driver/node_modules/@react-native/gradle-plugin' does not exist.

* 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 https://help.gradle.org.

BUILD FAILED in 395ms
error Failed to install the app. Command failed with exit code 1: ./gradlew app:installDebug -PreactNativeDevServerPort=8081 -PreactNativeArchitectures=arm64-v8a FAILURE: Build failed with an exception. * Where:
Settings file '/Users/maheshmuttinti/Documents/abcdef/driver/android/settings.gradle' line: 2 * What went wrong:
Error resolving plugin [id: 'com.facebook.react.settings']
> Included build '/Users/maheshmuttinti/Documents/abcdef/driver/node_modules/@react-native/gradle-plugin' does not exist. * 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 https://help.gradle.org. BUILD FAILED in 395ms.
info Run CLI with --verbose flag for more details.
 ELIFECYCLE  Command failed with exit code 1.
 ELIFECYCLE  Command failed with exit code 1.

Reproducer

https://github.com/maheshmuttintidev/react-native-mahesh-muttinti

Screenshots and Videos

No response

cortinico commented 2 weeks ago

https://github.com/maheshmuttintidev/react-native-mahesh-muttinti

This repo is different from what you're describing. Did you forget to commit your changes? @maheshmuttintidev

react-native-bot commented 2 weeks ago
:warning: Missing Reproducible Example
:information_source: We could not detect a reproducible example in your issue report. Please provide either:
giapdq04 commented 2 weeks ago

try "cd android", ''./gradlew clean'

itsmuntadhar commented 2 weeks ago

possible dup of #46210 and #46046 ?

had this error after upgrading to 0.76 and this comment solved it

cortinico commented 2 weeks ago

possible dup of #46210 and #46046 ?

@itsmuntadhar not a dupe of #46210 as that's windows specific.

But yeah most likely a duplicate of #46046

I'm waiting for a response from @maheshmuttintidev as otherwise we can close this one

maheshmuttintidev commented 2 weeks ago

i resolved this by installing these packages

{
    "@react-native/codegen": "^0.76.0",
    "@react-native/gradle-plugin": "^0.76.0",
}
cortinico commented 2 weeks ago

i resolved this by installing these packages

Just note that you should not install those packages directly. They are dependency of react-native instead.

Your build was failing for another reason (most likely another package importing an older version of those packages), and if you forget to update those packages in the future, your build will fail again.

manojmehra9014 commented 2 weeks ago

yarn add @react-native/gradle-plugin

remove node_module yarn install/npm install

resolve this issue