how can i fix react-native run-android first run error - android

When i have created a project with react-native and run a
react-native run-android
the build fails as shown in the log below.
How do I fix it?
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
(node:29740) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
Jetifier found 879 file(s) to forward-jetify. Using 12 workers...
info Starting JS server...
info Installing the app...
:ReactNative:Unexpected empty result of running '[node, C:\Users\a0105\OneDrive\바탕 ?���?\momentum\AS\node_modules\react-native\node_modules\#react-native-community\cli\build\bin.js, config]' command.
:ReactNative:Running '[node, C:\Users\a0105\OneDrive\바탕 ?���?\momentum\AS\node_modules\react-native\node_modules\#react-native-community\cli\build\bin.js, config]' command failed.
FAILURE: Build failed with an exception.
* Where:
Script 'C:\Users\a0105\OneDrive\���� ȭ��\momentum\AS\node_modules\#react-native-community\cli-platform-android\native_modules.gradle' line: 213
* What went wrong:
A problem occurred evaluating script.
> internal/modules/cjs/loader.js:905 throw err; ^Error: Cannot find module 'C:\Users\a0105\OneDrive\諛�?�? �솕硫�\momentum\AS\node_modules\react-native\node_modules\#react-native-community\cli\build\bin.js' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15) at Function.Module._load (internal/modules/cjs/loader.js:746:27) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12) at internal/main/run_main_module.js:17:47 { code: 'MODULE_NOT_FOUND', requireStack: []}
* 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 3s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
:ReactNative:Unexpected empty result of running '[node, C:\Users\a0105\OneDrive\바탕 ?���?\momentum\AS\node_modules\react-native\node_modules\#react-native-community\cli\build\bin.js, config]' command.
:ReactNative:Running '[node, C:\Users\a0105\OneDrive\바탕 ?���?\momentum\AS\node_modules\react-native\node_modules\#react-native-community\cli\build\bin.js, config]' command failed.
FAILURE: Build failed with an exception.
* Where:
Script 'C:\Users\a0105\OneDrive\���� ȭ��\momentum\AS\node_modules\#react-native-community\cli-platform-android\native_modules.gradle' line: 213
* What went wrong:
A problem occurred evaluating script.
> internal/modules/cjs/loader.js:905 throw err; ^Error: Cannot find module 'C:\Users\a0105\OneDrive\諛�?�? �솕硫�\momentum\AS\node_modules\react-native\node_modules\#react-native-community\cli\build\bin.js' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15) at Function.Module._load (internal/modules/cjs/loader.js:746:27) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12) at internal/main/run_main_module.js:17:47 { code: 'MODULE_NOT_FOUND', requireStack: []}
* 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 3s
at makeError (C:\Users\a0105\OneDrive\바탕 화면\momentum\AS\node_modules\execa\index.js:174:9)
at C:\Users\a0105\OneDrive\바탕 화면\momentum\AS\node_modules\execa\index.js:278:16
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async runOnAllDevices (C:\Users\a0105\OneDrive\바탕 화면\momentum\AS\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:106:5)
at async Command.handleAction (C:\Users\a0105\OneDrive\바탕 화면\momentum\AS\node_modules\react-native\node_modules\#react-native-community\cli\build\index.js:192:9)
info Run CLI with --verbose flag for more details.]
I tried many ways but it didn't work. Execution using expo was successful.
And when I run react-native info, the log below appears.
info Fetching system and libraries information...
(node:29320) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
error Unable to print environment info.
Error: Command failed: wmic os get Caption
'wmic'��(��) ���� �Ǵ� �ܺ� ����, ������ �� �ִ� ���α׷�, �Ǵ�
��ġ ������ �ƴմϴ�.

i fix it
check the jdk8 and Using a physical device

Related

How I run my react-native project(Failed to install the app. Make sure you have the Android development environment set up:

I trying to run my react-native anroid project. I use android 12 (S). And sdk verison 31.0.0. But i cant run my project.
My error :
PS C:\Users\omer2\OneDrive\Masaüstü\BosBirProje> npm run android
> BosBirProje#0.0.1 android
> react-native run-android
info JS server already running.
info Launching emulator...
info Successfully launched emulator.
info Installing the app...
:ReactNative:Unexpected empty result of running '[node, C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\#react-n
ative-community\cli\build\bin.js, config]' command.
:ReactNative:Running '[node, C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\#react-native-community\cli\build\b
in.js, config]' command failed.
FAILURE: Build failed with an exception.
* Where:
Script 'C:\Users\omer2\OneDrive\Masa�st�\BosBirProje\node_modules\#react-native-community\cli-platform-android\native_modu
les.gradle' line: 413
* What went wrong:
A problem occurred evaluating script.
> node:internal/modules/cjs/loader:998 throw err; ^Error: Cannot find module 'C:\Users\omer2\OneDrive\Masaüstü\BosBirP
roje\node_modules\#react-native-community\cli\build\bin.js' at Module._resolveFilename (node:internal/modules/cjs/loade
r:995:15) at Module._load (node:internal/modules/cjs/loader:841:27) at Function.executeUserEntryPoint [as runMain] (
node:internal/modules/run_main:81:12) at node:internal/main/run_main_module:23:47 { code: 'MODULE_NOT_FOUND', require
Stack: []}Node.js v18.12.1
* 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
BU�LD FAILED in 6s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/do
cs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
:ReactNative:Unexpected empty result of running '[node, C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\#react-n
ative-community\cli\build\bin.js, config]' command.
:ReactNative:Running '[node, C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\#react-native-community\cli\build\b
in.js, config]' command failed.
FAILURE: Build failed with an exception.
* Where:
Script 'C:\Users\omer2\OneDrive\Masa�st�\BosBirProje\node_modules\#react-native-community\cli-platform-android\native_modu
les.gradle' line: 413
* What went wrong:
A problem occurred evaluating script.
> node:internal/modules/cjs/loader:998 throw err; ^Error: Cannot find module 'C:\Users\omer2\OneDrive\Masaüstü\BosBirP
roje\node_modules\#react-native-community\cli\build\bin.js' at Module._resolveFilename (node:internal/modules/cjs/loade
r:995:15) at Module._load (node:internal/modules/cjs/loader:841:27) at Function.executeUserEntryPoint [as runMain] (
node:internal/modules/run_main:81:12) at node:internal/main/run_main_module:23:47 { code: 'MODULE_NOT_FOUND', require
Stack: []}Node.js v18.12.1
* 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
BU�LD FAILED in 6s
at makeError (C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\execa\index.js:174:9)
at C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\execa\index.js:278:16
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async runOnAllDevices (C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\react-native\node_modules\#react-n
ative-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\#react-native-community\cli\b
uild\index.js:108:9)
info Run CLI with --verbose flag for more details.
I trying to react-native doctor and my react-native doctor output:
PS C:\Users\omer2\OneDrive\Masaüstü\BosBirProje> npx #react-native-community/cli doctor
Common
✓ Node.js
✓ npm
Android
✓ JDK
✓ Android Studio - Required for building and installing your app on Android
✖ Android SDK - Required for building and installing your app on Android
- Versions found: N/A
- Version supported: 31.0.0
✓ ANDROID_HOME
Errors: 1
Warnings: 0
Attempting to fix 1 issue...
Android
✔ Android SDK configured. You might need to restart your PC for all changes to take effect.
I reboot my pc as suggested and do npm run android. And my new output:
PS C:\Users\omer2\OneDrive\Masaüstü\BosBirProje> npm run android
> BosBirProje#0.0.1 android
> react-native run-android
info JS server already running.
info Installing the app...
:ReactNative:Unexpected empty result of running '[node, C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\#react-n
ative-community\cli\build\bin.js, config]' command.
:ReactNative:Running '[node, C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\#react-native-community\cli\build\b
in.js, config]' command failed.
FAILURE: Build failed with an exception.
* Where:
Script 'C:\Users\omer2\OneDrive\Masa�st�\BosBirProje\node_modules\#react-native-community\cli-platform-android\native_modu
les.gradle' line: 413
* What went wrong:
A problem occurred evaluating script.
> node:internal/modules/cjs/loader:998 throw err; ^Error: Cannot find module 'C:\Users\omer2\OneDrive\Masaüstü\BosBirP
roje\node_modules\#react-native-community\cli\build\bin.js' at Module._resolveFilename (node:internal/modules/cjs/loade
r:995:15) at Module._load (node:internal/modules/cjs/loader:841:27) at Function.executeUserEntryPoint [as runMain] (
node:internal/modules/run_main:81:12) at node:internal/main/run_main_module:23:47 { code: 'MODULE_NOT_FOUND', require
Stack: []}Node.js v18.12.1
* 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
BU�LD FAILED in 6s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/do
cs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
:ReactNative:Unexpected empty result of running '[node, C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\#react-n
ative-community\cli\build\bin.js, config]' command.
:ReactNative:Running '[node, C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\#react-native-community\cli\build\b
in.js, config]' command failed.
FAILURE: Build failed with an exception.
* Where:
Script 'C:\Users\omer2\OneDrive\Masa�st�\BosBirProje\node_modules\#react-native-community\cli-platform-android\native_modu
les.gradle' line: 413
* What went wrong:
A problem occurred evaluating script.
> node:internal/modules/cjs/loader:998 throw err; ^Error: Cannot find module 'C:\Users\omer2\OneDrive\Masaüstü\BosBirP
roje\node_modules\#react-native-community\cli\build\bin.js' at Module._resolveFilename (node:internal/modules/cjs/loade
r:995:15) at Module._load (node:internal/modules/cjs/loader:841:27) at Function.executeUserEntryPoint [as runMain] (
node:internal/modules/run_main:81:12) at node:internal/main/run_main_module:23:47 { code: 'MODULE_NOT_FOUND', require
Stack: []}Node.js v18.12.1
* 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
BU�LD FAILED in 6s
at makeError (C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\execa\index.js:174:9)
at C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\execa\index.js:278:16
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async runOnAllDevices (C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\react-native\node_modules\#react-n
ative-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\#react-native-community\cli\b
uild\index.js:108:9)
info Run CLI with --verbose flag for more details.
1-) Finally I added the local.properties file to this location "C:\Users\omer2\OneDrive\Desktop\BosBirProject\android".
2-) I added the following commands in the gradle.properties file:
newArchEnabled=false
android.useAndroidX=true
android.enableJetifier=true
3-) I updated and reinstalled all npm packages
4-) I also tried to :
npm uninstall -g react-native-cli
npm install -g react-native-cli
npm install -g react-native
5-) I can't run the project even though I did all these, what would you recommend to me?

Cannot initialize React Native CLI Project

I am now using react native cli in my crud project,but after I initialized the project and ran npx react-native run-android inside project folder
it gave me these errors :
npx react-native run-android
info Starting JS server...
* daemon not running; starting now at tcp:5037
* daemon started successfully
info Launching emulator...
info Successfully launched emulator.
info Installing the app...
:ReactNative:Unexpected empty result of running '[node, C:\Users\invis\OneDrive\�?rea de Trabalho\reac\app\node_modules\#react-native-community\cli\build\bin.js, config]' command.
:ReactNative:Running '[node, C:\Users\invis\OneDrive\�?rea de Trabalho\reac\app\node_modules\#react-native-community\cli\build\bin.js, config]' command failed.
FAILURE: Build failed with an exception.
* Where:
Script 'C:\Users\invis\OneDrive\�rea de Trabalho\reac\app\node_modules\#react-native-community\cli-platform-android\native_modules.gradle' line: 413
* What went wrong:
A problem occurred evaluating script.
> node:internal/modules/cjs/loader:988 throw err; ^Error: Cannot find module 'C:\Users\invis\OneDrive\�rea de Trabalho\reac\app\node_modules\#react-native-community\cli\build\bin.js' at Function.Module._resolveFilename (node:internal/modules/cjs/loader:985:15) at Function.Module._load (node:internal/modules/cjs/loader:833:27) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) at node:internal/main/run_main_module:22:47 { code: 'MODULE_NOT_FOUND', requireStack: []}
* 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 8s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
:ReactNative:Unexpected empty result of running '[node, C:\Users\invis\OneDrive\�?rea de Trabalho\reac\app\node_modules\#react-native-community\cli\build\bin.js, config]' command.
:ReactNative:Running '[node, C:\Users\invis\OneDrive\�?rea de Trabalho\reac\app\node_modules\#react-native-community\cli\build\bin.js, config]' command failed.
FAILURE: Build failed with an exception.
* Where:
Script 'C:\Users\invis\OneDrive\�rea de Trabalho\reac\app\node_modules\#react-native-community\cli-platform-android\native_modules.gradle' line: 413
* What went wrong:
A problem occurred evaluating script.
> node:internal/modules/cjs/loader:988 throw err; ^Error: Cannot find module 'C:\Users\invis\OneDrive\�rea de Trabalho\reac\app\node_modules\#react-native-community\cli\build\bin.js' at Function.Module._resolveFilename (node:internal/modules/cjs/loader:985:15) at Function.Module._load (node:internal/modules/cjs/loader:833:27) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) at node:internal/main/run_main_module:22:47 { code: 'MODULE_NOT_FOUND', requireStack: []}
* 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 8s
at makeError (C:\Users\invis\OneDrive\Área de Trabalho\reac\app\node_modules\#react-native-community\cli-platform-android\node_modules\execa\index.js:174:9)
at C:\Users\invis\OneDrive\Área de Trabalho\reac\app\node_modules\#react-native-community\cli-platform-android\node_modules\execa\index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (C:\Users\invis\OneDrive\Área de Trabalho\reac\app\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (C:\Users\invis\OneDrive\Área de Trabalho\reac\app\node_modules\#react-native-community\cli\build\index.js:142:9)
info Run CLI with --verbose flag for more details.
At first I installed react native and react-native-community-cli globally and I saw it was a bad practice so I uninstalled it globally and installed again but now locally
I saw in a website the command
react-native doctor
And I saw at first some problems with SDK so I installed all packages necessary and it still AFTER ALL THIS gives me the same error again and again
I also tried deleting node modules ang installing again with
npm install
but unfortunately it did not work,if anyone has any ideas please send it ,I will be very grateful !!!
After A LOT of research,I found out that because my path system is written in portuguese ,my desktop is named "Área de Trabalho" ,it did not worked,I changed it to OneDrive directory which is 1 level upper in the directory tree and it DID worked fine!!! Hope I helped someone with the same problem!!! Have a good day !!!

react-native run-android failed M1

~/RNSTAMPY  react-native run-android  1 ✘ ╱ took 41s ╱ at 10:24:15 PM
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
(node:4459) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use node --trace-warnings ... to show where the warning was created)
Jetifier found 1119 file(s) to forward-jetify. Using 8 workers...
info JS server already running.
info Launching emulator...
info Successfully launched emulator.
info Installing the app...
Task :app:compileDebugJavaWithJavac FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings
93 actionable tasks: 2 executed, 91 up-to-date
/Users/leeseungsup/RNSTAMPY/android/app/src/main/java/com/rnstampy/MainActivity.java:2: error: class, interface, or enum expected
package com.rnstampy;
^
1 error
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
Compilation failed; see the compiler error output for details.
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 3s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
/Users/leeseungsup/RNSTAMPY/android/app/src/main/java/com/rnstampy/MainActivity.java:2: error: class, interface, or enum expected
package com.rnstampy;
^
1 error
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
Compilation failed; see the compiler error output for details.
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 3s
at makeError (/Users/leeseungsup/RNSTAMPY/node_modules/#react-native-community/cli-platform-android/node_modules/execa/index.js:174:9)
at /Users/leeseungsup/RNSTAMPY/node_modules/#react-native-community/cli-platform-android/node_modules/execa/index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (/Users/leeseungsup/RNSTAMPY/node_modules/#react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:109:5)
at async Command.handleAction (/Users/leeseungsup/RNSTAMPY/node_modules/#react-native-community/cli/build/index.js:192:9)
info Run CLI with --verbose flag for more details.
run-ios is ok
run-android => android emulator opens but can't install my app.
When I ran android emulator in EXPO cli, it worked well!
but in react-native-cli environment, it doesn't work!!
react-native-cli: 2.0.1
react-native: 0.69.3
please help me~~
I solved my problem.
/Users/leeseungsup/RNSTAMPY/android/app/src/main/java/com/rnstampy/MainActivity.java:2: error: class, interface, or enum expected package com.rnstampy; ^ 1 error
this was my problem.
I moved [package com.rnstampy;] on the TOP. that's all.
It worked.

How can i fix 'npx react-native run-android' error?

I use 'npx react-native run-android' command and get this error:
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
:ReactNative:Unexpected empty result of running '[node, C:\Users\aisir\OneDrive\Рабочий стол\RNTestWithNode\clientRN\node_modules\#react-native-community\cli\build\bin.js, config]' command.
:ReactNative:Running '[node, C:\Users\aisir\OneDrive\Рабочий стол\RNTestWithNode\clientRN\node_modules\#react-native-community\cli\build\bin.js, config]' command failed.
FAILURE: Build failed with an exception.
* Where:
Script 'C:\Users\aisir\OneDrive\������� ����\RNTestWithNode\clientRN\node_modules\#react-native-community\cli-platform-android\native_modules.gradle' line: 195
* What went wrong:
A problem occurred evaluating script.
> internal/modules/cjs/loader.js:968 throw err; ^Error: Cannot find module 'C:\Users\aisir\OneDrive\Рабочий стол\RNTestWithNode\clientRN\node_modules\#react-native-community\cli\build\bin.js' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15) at Function.Module._load (internal/modules/cjs/loader.js:841:27) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12) at internal/main/run_main_module.js:17:47 { code: 'MODULE_NOT_FOUND', requireStack: []}
* 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 6s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
:ReactNative:Unexpected empty result of running '[node, C:\Users\aisir\OneDrive\Рабочий стол\RNTestWithNode\clientRN\node_modules\#react-native-community\cli\build\bin.js, config]' command.
Does some one know how to fix it?
I found how to fix it. I changed the version of my project.

gradlew assembleRelease it gives the following error in react-native

I want to make apk file of my application code, but whenever I am running gradlew assembleRelease it gives the following error, I just want to create the build with anything, as I have to deliver my project on Monday. Any help will be appreciated
C:\Users\dines\Documents\ANUJ\managementportal\android>gradlew assembleRelease
:ReactNative:Unexpected empty result of running '[node, undefined, config]' command.
:ReactNative:Running '[node, undefined, config]' command failed.
FAILURE: Build failed with an exception.
* Where:
Script 'C:\Users\dines\Documents\ANUJ\managementportal\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:584 throw err; ^Error: Cannot find module 'C:\Users\dines\Documents\ANUJ\managementportal\android\undefined' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15) at Function.Module._load (internal/modules/cjs/loader.js:508:25) at Function.Module.runMain (internal/modules/cjs/loader.js:754:12) at startup (internal/bootstrap/node.js:283:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
* 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 2s
C:\Users\dines\Documents\ANUJ\managementportal\android>
Follow This Step:
1) C:\Users\dines\Documents\ANUJ\managementportal> react-native run-android
2) C:\Users\dines\Documents\ANUJ\managementportal> cd android
3) C:\Users\dines\Documents\ANUJ\managementportal\android> ./gradlew assembleRelease
All Process is done after getting release app
Project folder > android > app > build > outputs > apk > release

Categories

Resources