I clone my project to windows pc ( until now worked on mac ).
After clone I run npm install.
When I trying to run react-native run-android I get error:
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
Here is the full log after react-native run-android command.
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1100 file(s) to forward-jetify. Using 8 workers...
info JS server already running.
info Installing the app...
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:mergeDebugAssets'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
> Could not find com.bugsnag:bugsnag-android:5.4.0-react-native.
Searched in the following locations:
- file:/C:/Users/ionia/.m2/repository/com/bugsnag/bugsnag-android/5.4.0-react-native/bugsnag-android-5.4.0-react-native.pom
- file:/C:/Users/ionia/Desktop/iCardApp/node_modules/react-native/android/com/bugsnag/bugsnag-android/5.4.0-react-native/bugsnag-android-5.4.0-react-native.pom
- file:/C:/Users/ionia/Desktop/iCardApp/node_modules/jsc-android/dist/com/bugsnag/bugsnag-android/5.4.0-react-native/bugsnag-android-5.4.0-react-native.pom
- https://dl.google.com/dl/android/maven2/com/bugsnag/bugsnag-android/5.4.0-react-native/bugsnag-android-5.4.0-react-native.pom
- https://jcenter.bintray.com/com/bugsnag/bugsnag-android/5.4.0-react-native/bugsnag-android-5.4.0-react-native.pom
- https://www.jitpack.io/com/bugsnag/bugsnag-android/5.4.0-react-native/bugsnag-android-5.4.0-react-native.pom
Required by:
project :app > project :bugsnag_react-native
> Could not find com.bugsnag:bugsnag-plugin-react-native:5.4.0-react-native.
Searched in the following locations:
- file:/C:/Users/ionia/.m2/repository/com/bugsnag/bugsnag-plugin-react-native/5.4.0-react-native/bugsnag-plugin-react-native-5.4.0-react-native.pom
- file:/C:/Users/ionia/Desktop/iCardApp/node_modules/react-native/android/com/bugsnag/bugsnag-plugin-react-native/5.4.0-react-native/bugsnag-plugin-react-native-5.4.0-react-native.pom
- file:/C:/Users/ionia/Desktop/iCardApp/node_modules/jsc-android/dist/com/bugsnag/bugsnag-plugin-react-native/5.4.0-react-native/bugsnag-plugin-react-native-5.4.0-react-native.pom
- https://dl.google.com/dl/android/maven2/com/bugsnag/bugsnag-plugin-react-native/5.4.0-react-native/bugsnag-plugin-react-native-5.4.0-react-native.pom
- https://jcenter.bintray.com/com/bugsnag/bugsnag-plugin-react-native/5.4.0-react-native/bugsnag-plugin-react-native-5.4.0-react-native.pom
- https://www.jitpack.io/com/bugsnag/bugsnag-plugin-react-native/5.4.0-react-native/bugsnag-plugin-react-native-5.4.0-react-native.pom
Required by:
project :app > project :bugsnag_react-native
* 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
C:\Users\ionia\Desktop\iCardApp>
Related
I got this error while react-native run-android. I tried ./gradlew clean ./gradlew -stop and wipe data, remove build folder, .gradle folder etc... But can't solve the problem.
Here is the error code I got.
Does anyone has an idea to solve that problem?
$ react-native run-android
warn Package #svgr/webpack has been ignored because it contains invalid configuration. Reason: Package subpath './package.json' is not defined by "exports" in (...)/node_modules/#svgr/webpack/package.json
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1888 file(s) to forward-jetify. Using 8 workers...
info JS server already running.
info Installing the app...
Starting a Gradle Daemon, 1 incompatible and 3 stopped Daemons could not be reused, use --status for details
> Configure project :lottie-react-native
WARNING:: The specified Android SDK Build Tools version (29.0.3) is ignored, as it is below the minimum supported version (30.0.2) for Android Gradle Plugin 4.2.2.
Android SDK Build Tools 30.0.2 will be used.
To suppress this warning, remove "buildToolsVersion '29.0.3'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
> Task :app:packageDebug FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings
495 actionable tasks: 5 executed, 490 up-to-date
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
(...)
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:packageDebug'.
> A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable
> com.android.ide.common.signing.KeytoolException: Failed to read key androiddebugkey from store "(...)/android/app/debug.keystore": keystore password was incorrect
* 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 14s
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
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
(...)
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:packageDebug'.
> A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable
> com.android.ide.common.signing.KeytoolException: Failed to read key androiddebugkey from store "(...)/android/app/debug.keystore": keystore password was incorrect```
At first was runing node 16.15 with JDK 18. thought it was a problem with the jdk. had to down grade to JDK 11. but still facing this problem. can any one help?
my virtual devices are already runing but for some reason i can
npx react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-
jetifier" flag.
Jetifier found 964 file(s) to forward-jetify. Using 8 workers...
info JS server already running.
'"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...
> Configure project :app
Unable to detect AGP versions for included builds. All projects in the build should use the
same AGP version. Class name for the included build object:
org.gradle.composite.internal.DefaultIncludedBuild$IncludedBuildImpl_Decorated.
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
6 actionable tasks: 6 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by
setting the sdk.dir path in your project's local properties file at
'C:\aldoobi\newaldoobi\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.
* 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
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or
by setting the sdk.dir path in your project's local properties file at
'C:\aldoobi\newaldoobi\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.
* Get more help at https://help.gradle.org
BUILD FAILED in 8s
at makeError (C:\aldoobi\newaldoobi\node_modules\execa\index.js:174:9)
at C:\aldoobi\newaldoobi\node_modules\execa\index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (C:\aldoobi\newaldoobi\node_modules\#react-native-community\cli-
platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (C:\aldoobi\newaldoobi\node_modules\#react-native-
community\cli\build\index.js:192:9)
info Run CLI with --verbose flag for more details.
i have tried changing the path in my computer variables; i have added ANDROID_HOME, JAVA_HOME and also tried to change the android virtual deveces to SDK R but nothing . can any one help?
I generated my project using native cli and I'm using "react-native": "0.67.3" and when I run npx react-native run-android everything is ok and it runs on my android studio emulator and I can write my code.
When I install "npm install #react-navigation/native" to use react navigation, it still works and there is no problem.
But in the second step based on react navigation docs, I need to install react navigation dependencies which are "npm install react-native-screens react-native-safe-area-context"
As soon as I install them, my code wont run and I encounter this fat error:
> Configure project :react-native-safe-area-context
Subproject ':react-native-safe-area-context' has location 'C:\Users\Moe\Desktop\covid\covid\node_modules\react-native-safe-area-context\android' which is outside of the project root. This behaviour has been deprecated and is scheduled to be removed in Gradle 8.0. Consult the upgrading guide for further information: https://docs.gradle.org/7.2/userguide/upgrading_version_7.html#deprecated_flat_project_structure
> Configure project :react-native-screens
Subproject ':react-native-screens' has location 'C:\Users\Moe\Desktop\covid\covid\node_modules\react-native-screens\android' which is outside of the project root. This behaviour has been deprecated and is scheduled to be removed in Gradle 8.0. Consult the upgrading guide for further information: https://docs.gradle.org/7.2/userguide/upgrading_version_7.html#deprecated_flat_project_structure
Adding a Configuration as a dependency is a confusing behavior which isn't recommended. This behaviour has been deprecated and is scheduled to be removed in Gradle 8.0. If you're interested in inheriting the dependencies from the Configuration you are adding, you should use Configuration#extendsFrom instead. See https://docs.gradle.org/7.2/dsl/org.gradle.api.artifacts.Configuration.html#org.gradle.api.artifacts.Configuration:extendsFrom(org.gradle.api.artifacts.Configuration[]) for more details.
> Task :app:mergeDebugAssets FAILED
11 actionable tasks: 11 executed
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDebugAssets'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find androidx.coordinatorlayout:coordinatorlayout:1.1.0.
Searched in the following locations:
- file:/C:/Users/Moe/Desktop/covid/covid/node_modules/react-native/android/androidx/coordinatorlayout/coordinatorlayout/1.1.0/coordinatorlayout-1.1.0.pom
- file:/C:/Users/Moe/Desktop/covid/covid/node_modules/jsc-android/dist/androidx/coordinatorlayout/coordinatorlayout/1.1.0/coordinatorlayout-1.1.0.pom
- https://repo.maven.apache.org/maven2/androidx/coordinatorlayout/coordinatorlayout/1.1.0/coordinatorlayout-1.1.0.pom
- https://dl.google.com/dl/android/maven2/androidx/coordinatorlayout/coordinatorlayout/1.1.0/coordinatorlayout-1.1.0.pom
- https://www.jitpack.io/androidx/coordinatorlayout/coordinatorlayout/1.1.0/coordinatorlayout-1.1.0.pom
Required by:
project :app > project :react-native-screens
> Could not find com.google.android.material:material:1.1.0.
Searched in the following locations:
- file:/C:/Users/Moe/Desktop/covid/covid/node_modules/react-native/android/com/google/android/material/material/1.1.0/material-1.1.0.pom
- file:/C:/Users/Moe/Desktop/covid/covid/node_modules/jsc-android/dist/com/google/android/material/material/1.1.0/material-1.1.0.pom
- https://repo.maven.apache.org/maven2/com/google/android/material/material/1.1.0/material-1.1.0.pom
- https://dl.google.com/dl/android/maven2/com/google/android/material/material/1.1.0/material-1.1.0.pom
- https://www.jitpack.io/com/google/android/material/material/1.1.0/material-1.1.0.pom
Required by:
project :app > project :react-native-screens
> Could not find androidx.core:core-ktx:1.5.0.
Searched in the following locations:
- file:/C:/Users/Moe/Desktop/covid/covid/node_modules/react-native/android/androidx/core/core-ktx/1.5.0/core-ktx-1.5.0.pom
- file:/C:/Users/Moe/Desktop/covid/covid/node_modules/jsc-android/dist/androidx/core/core-ktx/1.5.0/core-ktx-1.5.0.pom
- https://repo.maven.apache.org/maven2/androidx/core/core-ktx/1.5.0/core-ktx-1.5.0.pom
- https://dl.google.com/dl/android/maven2/androidx/core/core-ktx/1.5.0/core-ktx-1.5.0.pom
- https://www.jitpack.io/androidx/core/core-ktx/1.5.0/core-ktx-1.5.0.pom
Required by:
project :app > project :react-native-screens
* 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 13s
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:
Execution failed for task ':app:mergeDebugAssets'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find androidx.coordinatorlayout:coordinatorlayout:1.1.0.
Searched in the following locations:
- file:/C:/Users/Moe/Desktop/covid/covid/node_modules/react-native/android/androidx/coordinatorlayout/coordinatorlayout/1.1.0/coordinatorlayout-1.1.0.pom
- file:/C:/Users/Moe/Desktop/covid/covid/node_modules/jsc-android/dist/androidx/coordinatorlayout/coordinatorlayout/1.1.0/coordinatorlayout-1.1.0.pom
- https://repo.maven.apache.org/maven2/androidx/coordinatorlayout/coordinatorlayout/1.1.0/coordinatorlayout-1.1.0.pom
- https://dl.google.com/dl/android/maven2/androidx/coordinatorlayout/coordinatorlayout/1.1.0/coordinatorlayout-1.1.0.pom
- https://www.jitpack.io/androidx/coordinatorlayout/coordinatorlayout/1.1.0/coordinatorlayout-1.1.0.pom
Required by:
project :app > project :react-native-screens
> Could not find com.google.android.material:material:1.1.0.
Searched in the following locations:
- file:/C:/Users/Moe/Desktop/covid/covid/node_modules/react-native/android/com/google/android/material/material/1.1.0/material-1.1.0.pom
- file:/C:/Users/Moe/Desktop/covid/covid/node_modules/jsc-android/dist/com/google/android/material/material/1.1.0/material-1.1.0.pom
- https://repo.maven.apache.org/maven2/com/google/android/material/material/1.1.0/material-1.1.0.pom
- https://dl.google.com/dl/android/maven2/com/google/android/material/material/1.1.0/material-1.1.0.pom
- https://www.jitpack.io/com/google/android/material/material/1.1.0/material-1.1.0.pom
Required by:
project :app > project :react-native-screens
> Could not find androidx.core:core-ktx:1.5.0.
Searched in the following locations:
- file:/C:/Users/Moe/Desktop/covid/covid/node_modules/react-native/android/androidx/core/core-ktx/1.5.0/core-ktx-1.5.0.pom
- file:/C:/Users/Moe/Desktop/covid/covid/node_modules/jsc-android/dist/androidx/core/core-ktx/1.5.0/core-ktx-1.5.0.pom
- https://repo.maven.apache.org/maven2/androidx/core/core-ktx/1.5.0/core-ktx-1.5.0.pom
- https://dl.google.com/dl/android/maven2/androidx/core/core-ktx/1.5.0/core-ktx-1.5.0.pom
- https://www.jitpack.io/androidx/core/core-ktx/1.5.0/core-ktx-1.5.0.pom
Required by:
project :app > project :react-native-screens
* 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 13s
at makeError (C:\Users\Moe\Desktop\covid\covid\node_modules\#react-native-community\cli-platform-android\node_modules\execa\index.js:174:9)
at C:\Users\Moe\Desktop\covid\covid\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\Moe\Desktop\covid\covid\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (C:\Users\Moe\Desktop\covid\covid\node_modules\#react-native-community\cli\build\index.js:192:9)
info Run CLI with --verbose flag for more details.
Show this error whenever I run react-native run-android
react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1598 file(s) to forward-jetify. Using 8 workers...
info JS server already running.
info Installing the app...
FAILURE: Build failed with an exception.
What went wrong:
Could not initialize class org.codehaus.groovy.runtime.InvokerHelper
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 808ms
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
How to fix this?
Can you try to navigate in the android directory and run this command
chmod 755 android/gradlew
and then try to run the npm run-android command.
When i run the react-native run-android i face this error.
I tried to downgrade my java version to 8 but still not working.
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 960 file(s) to forward-jetify. Using 8 workers...
info JS server already running.
info Installing the app...
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.0.1/userguide/command_line_interface.html#sec:command_line_warnings
FAILURE: Build failed with an exception.
* What went wrong:
Task 'installDebug' not found in project ':app'.
* Try:
Run gradlew tasks to get a list of available tasks. 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. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
* What went wrong:
Task 'installDebug' not found in project ':app'.
* Try:
Run gradlew tasks to get a list of available tasks. 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 (D:\freelance\SuperDaily\node_modules\execa\index.js:174:9)
at D:\freelance\SuperDaily\node_modules\execa\index.js:278:16
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async runOnAllDevices (D:\freelance\SuperDaily\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:5)
at async Command.handleAction (D:\freelance\SuperDaily\node_modules\react-native\node_modules\#react-native-community\cli\build\index.js:186:9)
I too got a similar error with this("node_modules/execa/index.js") file.
I resolved my error using the 2 commands given below
npm uninstall -g react-native-cli
yarn global add #react-native-community/cli
If my solution doesn't work then check some other solutions here
react-native run-android --variant Huaweidebug
Run with above command.
it should fixed but in case error exists then open project in android studio