2

PS E:\My Project\sample> npx react-native run-android info Starting JS server... '"adb"' is not recognized as an internal or external command, operable program or batch file. info Launching emulator... error Failed to launch emulator. Reason: No emulators found as an output of emulator -list-avds. warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch. info Installing the app... Downloading https://services.gradle.org/distributions/gradle-7.5.1-all.zip ...............10%................20%................30%................40%................50%................60%...............70%................80%................90%................100%

Welcome to Gradle 7.5.1!

Here are the highlights of this release:

  • Support for Java 18
  • Support for building with Groovy 4
  • Much more responsive continuous builds
  • Improved diagnostics for dependency resolution

For more details see https://docs.gradle.org/7.5.1/release-notes.html

Starting a Gradle Daemon (subsequent builds will be faster)

Task :react-native-gradle-plugin:compileKotlin w: E:\My Project\sample\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\ReactExtension.kt: (10, 37): 'BaseVariant' is deprecated. Deprecated in Java w: E:\My Project\sample\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\ReactExtension.kt: (119, 30): 'BaseVariant' is deprecated. Deprecated in Java w: E:\My Project\sample\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\ReactExtension.kt: (135, 26): 'BaseVariant' is deprecated. Deprecated in Java w: E:\My Project\sample\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\ReactExtension.kt: (157, 32): 'BaseVariant' is deprecated. Deprecated in Java w: E:\My Project\sample\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\ReactExtension.kt: (163, 31): 'BaseVariant' is deprecated. Deprecated in Java w: E:\My Project\sample\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\ReactExtension.kt: (171, 36): 'BaseVariant' is deprecated. Deprecated in Java w: E:\My Project\sample\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\ReactPlugin.kt: (114, 48): 'reactRoot: DirectoryProperty' is deprecated. reactRoot was confusing and has been replace with root to point to your root project and reactNativeDir to point to the folder of the react-native NPM package w: E:\My Project\sample\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\TaskConfiguration.kt: (10, 37): 'ApplicationVariant' is deprecated. Deprecated in Java w: E:\My Project\sample\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\TaskConfiguration.kt: (11, 37): 'BaseVariant' is deprecated. Deprecated in Java w: E:\My Project\sample\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\TaskConfiguration.kt: (12, 37): 'LibraryVariant' is deprecated. Deprecated in Java w: E:\My Project\sample\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\TaskConfiguration.kt: (27, 51): 'BaseVariant' is deprecated. Deprecated in Java w: E:\My Project\sample\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\TaskConfiguration.kt: (130, 12): 'ApplicationVariant' is deprecated. Deprecated in Java w: E:\My Project\sample\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\TaskConfiguration.kt: (131, 12): 'LibraryVariant' is deprecated. Deprecated in Java w: E:\My Project\sample\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\TaskConfiguration.kt: (251, 14): 'BaseVariant' is deprecated. Deprecated in Java

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 5 actionable tasks: 5 executed

FAILURE: Build failed with an exception.

  • What went wrong: Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.

SDK location not found. Define a valid SDK location with an ANDROID_HOME environment variable or by setting the sdk.dir path in your project's local properties file at 'E:\My Project\sample\android\local.properties'.

  • 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.

BUILD FAILED in 34m 15s

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.

  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Sep 23 '22 at 12:49

1 Answers1

0

You android home property is not set right, here you can find how to do it -> SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable

Alija Fajic
  • 556
  • 6
  • 17