PS D:New folder5projectproject-frontend>> npx react-native run-android --verbose
(node:18992) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
info JS server already running.
info Installing the app...
debug Running command "cd android && gradlew.bat app:installDebug -PreactNativeDevServerPort=8081"
Error executing command '[node, D:New folder5projectproject-frontendnode_modules@react-native-communityclibuildbin.js, config, --platform, android]': Command '[node, D:New folder5projectproject-frontendnode_modules@react-native-communityclibuildbin.js, config, --platform, android]' failed with exit code 1.
FAILURE: Build failed with an exception.
* Where:
Script 'D:New folder5projectproject-frontendnode_modules@react-native-communitycli-platform-androidnative_modules.gradle' line: 420
* What went wrong:
A problem occurred evaluating script.
> Command '[node, D:New folder5projectproject-frontendnode_modules@react-native-communityclibuildbin.js, config, --platform, android]' failed with exit code 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
BUILD FAILED in 2s
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
FAILURE: Build failed with an exception.
* Where:
Script 'D:New folder5projectproject-frontendnode_modules@react-native-communitycli-platform-androidnative_modules.gradle' line: 420
* What went wrong:
A problem occurred evaluating script.
> Command '[node, D:New folder5projectproject-frontendnode_modules@react-native-communityclibuildbin.js, config, --platform, android]' failed with exit code 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
BUILD FAILED in 2s
at makeError (D:New folder5projectproject-frontendnode_modulesreact-nativenode_modulesexecaindex.js:174:9)
at D:New folder5projectproject-frontendnode_modulesreact-nativenode_modulesexecaindex.js:278:16
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async runOnAllDevices (D:New folder5projectproject-frontendnode_modulesreact-nativenode_modules@react-native-communitycli-platform-androidbuildcommandsrunAndroidrunOnAllDevices.js:109:5)
at async Command.handleAction (D:New folder5projectproject-frontendnode_modulesreact-nativenode_modules@react-native-communityclibuildindex.js:142:9)
I was trying to run this app may friend made on my laptop using an external android device this is when i ran into this error
I don’t know what this error is or what is going on i tried chat gpt and all but was not able to fix it i don’t even understand why this error is there any help would be appreciated!
edit:–
After going through some of the same type errors i came across on SoF
i found that removing some specific line from some files will reveal the real error
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
i removed this line from my build.gradle and settings.gradle file
and got a new type of error
WARNING:We recommend using a newer Android Gradle plugin to use compileSdk = 33
This Android Gradle plugin (7.2.1) was tested up to compileSdk = 32
This warning can be suppressed by adding
android.suppressUnsupportedCompileSdk=33
to this project's gradle.properties
The build will continue, but you are strongly encouraged to update your project to
use a newer Android Gradle Plugin that has been tested with compileSdk = 33
WARNING:We recommend using a newer Android Gradle plugin to use compileSdk = 33
This Android Gradle plugin (7.2.1) was tested up to compileSdk = 32
This warning can be suppressed by adding
android.suppressUnsupportedCompileSdk=33
to this project's gradle.properties
The build will continue, but you are strongly encouraged to update your project to
use a newer Android Gradle Plugin that has been tested with compileSdk = 33
> 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.5.1/userguide/command_line_interface.html#sec:command_line_warnings
and this
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
Warning: This version only understands SDK XML versions up to 3 but an SDK XML file of version 4 was encountered. This can happen if you use versions of Android Studio and the command-line tools that were released at different times.
D:New folder5projectproject-frontendandroidappsrcmainjavacombasenseMainApplication.java:5: error: cannot find symbol
import com.facebook.react.PackageList;
^
symbol: class PackageList
location: package com.facebook.react
D:New folder5projectproject-frontendandroidappsrcmainjavacombasensenewarchitectureMainApplicationReactNativeHost.java:5: error: cannot find symbol
import com.facebook.react.PackageList;
^
symbol: class PackageList
location: package com.facebook.react
D:New folder5projectproject-frontendandroidappsrcmainjavacombasenseMainApplication.java:32: error: cannot find symbol
List<ReactPackage> packages = new PackageList(this).getPackages();
^
symbol: class PackageList
D:New folder5projectproject-frontendandroidappsrcmainjavacombasensenewarchitectureMainApplicationReactNativeHost.java:47: error: cannot find symbol
List<ReactPackage> packages = new PackageList(this).getPackages();
^
symbol: class PackageList
location: class MainApplicationReactNativeHost
Note: D:New folder5projectproject-frontendandroidappsrcdebugjavacombasenseReactNativeFlipper.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
4 errors
Sumit mishra is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.