PS C:\Users\User\Projects\Auth\Authenetication> npm run android Authenetication@0.0.1…
- User
PS C:\Users\User\Projects\Auth\Authenetication> npm run android
Authenetication@0.0.1 android react-native run-android
info JS server already running. info Installing the app...
Configure project :app ##############################
Using react.gradle in your project is deprecated! You should move to "apply plugin: com.facebook.react" https://github.com/facebook/react-native/blob/main/template/android/app/build.gradlct will not build anymore.e e ############################## <=============> 100% CONFIGURING [3s] 5 actionable tasks: 5 up-to-date :debugRuntimeClasspath > maven-metadata.xml FAILURE: Build failed with an exception.
* What went wrong: Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'. Could not find any matches for com.facebook.react:react-native:+ as no versions of com.facebook.react:react-native are available. Required by: project :app Could not find any matches for com.facebook.react:hermes-engine:+ as no versions of com.facebook.react:hermes-engine are available. Required by: project :app
* 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 5s
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.
* What went wrong: Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'. Could not find any matches for com.facebook.react:react-native:+ as no versions of com.facebook.react:react-native are available. Required by: project :app Could not find any matches for com.facebook.react:hermes-engine:+ as no versions of com.facebook.react:hermes-engine are available. Required by: project :app
* 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.
- Assistant
This error message suggests that the build is failing because the dependencies of the task ':app:compileDebugJavaWithJavac' cannot be resolved. Specifically, the versions of 'com.facebook.react:react-native' and 'com.facebook.react:hermes-engine' cannot be found.
It's recommended to try running the command "npx react-native upgrade" to upgrade the version of react-native to the latest version.
Also, you can try to remove the node_modules folder and run "npm install" to reinstall the dependencies.
If the problem persists, you can check the version of react-native in your package.json file and make sure it is compatible with the version of react-native that you have installed.
- User
i try upgrade but it already lastest version, i also try to remove node_modules & run "npm install" but still got build fail
- Assistant
If you've tried upgrading to the latest version of React Native and reinstalling the dependencies and the problem still persists, there may be a problem with the version of Gradle being used.
You can try updating the version of Gradle in the android/build.gradle file and make sure it's compatible with the version of React Native you're using.
Another possible solution is to run "./gradlew clean" in the android directory to clean up the project and then try running the "npm run android" command again.
You can also check if there any other dependencies that are not compatible with the version of React-Native you're using, you can check the version of other dependencies in your package.json file and make sure they're compatible with the version of React Native you're using.
It's also worth checking the version of JDK and android studio, make sure they are compatible with your React-Native version.
- User
how do i updating version of gradle ?
- Assistant
To update the version of Gradle in your React Native project, you will need to make changes in the android/build.gradle file.
- Open the android/build.gradle file in your text editor.
- Look for the line that specifies the Gradle version, it should look something like this:
codedependencies { classpath "com.android.application:gradle:3.1.4" }- Update the version number to the latest version of Gradle. You can check the latest version on the Gradle website https://gradle.org/releases/.
- Save the changes and close the file.
It's also recommended to check the version of gradle in your android/gradle/wrapper/gradle-wrapper.properties file, it should match with the version of gradle in the android/build.gradle file.
After updating the Gradle version, you should re-run the "npm run android" command to see if the build error is resolved.