@react-native-community/cli-platform-android/native_modules.gradle Build failed with an exception
Environment
Model Name: MacBook Air Model Identifier: MacBookAir10,1 Processor Name: Unknown Processor Speed: 2.4 GHz Number of Processors: 1 Total Number of Cores: 8 L2 Cache: 8 MB Memory: 16 GB yarn: v1.22.18
Description
I am trying to run a react native app which is a storybook react native components but i am receiving an error like this.
Starting a Gradle Daemon, 2 stopped Daemons could not be reused, use --status for details
:ReactNative:Unexpected empty result of running '[node, -e, console.log(require('react-native/cli').bin);]' command.
:ReactNative:Running '[node, -e, console.log(require('react-native/cli').bin);]' command failed.
FAILURE: Build failed with an exception.
* Where:
Script '/Users/ednaaaj/Works/airasia/lob-react-native-components/node_modules/@react-native-community/cli-platform-android/native_modules.gradle' line: 170
* What went wrong:
A problem occurred evaluating script.
> internal/modules/cjs/loader.js:888 throw err; ^Error: Cannot find module 'react-native/cli'Require stack:- /Users/ednaaaj/.gradle/daemon/5.5/[eval] at Function.Module._resolveFilename (internal/modules/cjs/loader.js:885:15) at Function.Module._load (internal/modules/cjs/loader.js:730:27) at Module.require (internal/modules/cjs/loader.js:957:19) at require (internal/modules/cjs/helpers.js:88:18) at [eval]:1:13 at Script.runInThisContext (vm.js:133:18) at Object.runInThisContext (vm.js:310:38) at internal/process/execution.js:77:19 at [eval]-wrapper:6:22 at evalScript (internal/process/execution.js:76:60) { code: 'MODULE_NOT_FOUND', requireStack: [ '/Users/ednaaaj/.gradle/daemon/5.5/[eval]' ]}
Reproducible Demo
A problem occurred configuring project ':react-native-screen-capture-secure'.
compileSdkVersion is not specified. Please add it to build.gradle
please help to i can fix and handle it problemn and how it works snapchat clone in react native
buildscript { ext { buildToolsVersion = "31.0.0" minSdkVersion = 21 compileSdkVersion = 31 targetSdkVersion = 31
if (System.properties['os.arch'] == "aarch64") {
// For M1 Users we need to use the NDK 24 which added support for aarch64
ndkVersion = "24.0.8215888"
} else {
// Otherwise we default to the side-by-side NDK version from AGP.
ndkVersion = "21.4.7075529"
}
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:7.0.4")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("de.undercouch:gradle-download-task:4.1.2")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
There hasn't been any activity on this issue in the past 3 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days.
did anyone find any solution to this problem?