ReactNative CLI getting error when using React Navigation - react-native

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.

Related

Failed to run a react native app run on Android emulator

I have a problem with building react native app on android emulator. I tried to crate app with Expo and everything works great on android device, android emulator(Android studio) and web. But when I try to create with React Native CLI a have a build error.
admin#users-MacBook-Pro secondProjectReactNative % npx react-native run-android
warn Multiple Podfiles were found: ios/Podfile,vendor/bundle/ruby/2.7.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/Podfile. Choosing ios/Podfile automatically. If you would like to select a different one, you can configure it via "project.ios.sourceDir". You can learn more about it here: https://github.com/react-native-community/cli/blob/master/docs/configuration.md
info Starting JS server...
/bin/sh: adb: command not found
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...
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 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 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 '/Users/admin/secondProjectReactNative/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 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
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 '/Users/admin/secondProjectReactNative/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 3s
at makeError (/Users/admin/secondProjectReactNative/node_modules/execa/index.js:174:9)
at /Users/admin/secondProjectReactNative/node_modules/execa/index.js:278:16
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async runOnAllDevices (/Users/admin/secondProjectReactNative/node_modules/#react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:109:5)
at async Command.handleAction (/Users/admin/secondProjectReactNative/node_modules/#react-native-community/cli/build/index.js:142:9)
info Run CLI with --verbose flag for more details.
What can be wrong? Thanks a lot.
I did everything what was in react native CLI quick start https://reactnative.dev/docs/next/environment-setup
I'm sure that PATH is added
admin#users-MacBook-Pro secondProjectReactNative % echo $PATH
/Users/admin/.rvm/gems/ruby-2.7.5/bin:/Users/admin/.rvm/gems/ruby-2.7.5#global/bin:/Users/admin/.rvm/rubies/ruby-2.7.5/bin:/Users/admin/.rvm/bin:/usr/local/opt/ruby#2.7/bin:/usr/local/opt/ruby#2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/usr/local/opt/ruby#2.7/bin:/Users/admin/Library/Android/sdk/tools:/Users/admin/Library/Android/sdk/platform-tools:/Users/admin/Library/Android/sdk/emulator:/Users/admin/Library/Android/sdk/platform-tools
I downloaded SDK through Android Studio.
Start android studio emulator before "run android" doesn't help.

Am having travel run react native CLI with android . i get so many error

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?

Could not find bugsnag plugin

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>

Cannot run the project after setting up react-native-firebase

Basically what I'm asking is if anyone knows how to install react-native-firebase and connect the project to firebase? It should be very easy but it's not working.
I'm using the docs here:
https://rnfirebase.io/#2-android-setup
But I'm installing react-native-firebase instead of react-native-firebase/app because I would like to use react-native-firebase SDK
I'm creating a new project using
npx react-native init newProject
then install the package:
npm install --save react-native-firebase
Then I create a new frebase project, add the google-services.json to the app folder, and add the module:
classpath 'com.google.gms:google-services:4.3.3'
(Android studio suggests using the latest version)
And:
apply plugin: 'com.google.gms.google-services'
After that I cannot run the project anymore.
It's stuck:
C:\Users\Omer\react-native1\haveri>npx react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1034 file(s) to forward-jetify. Using 8 workers...
info Starting JS server...
info Installing the app...
> Configure project :react-native-firebase
react-native-firebase: using React Native prebuilt binary from C:\Users\Omer\react-native1\haveri\node_modules\react-native\android
> Task :app:stripDebugDebugSymbols UP-TO-DATE
Compatible side by side NDK version was not found.
<============-> 99% EXECUTING [1m 11s] > IDLE > IDLE > IDLE > IDLE > IDLE > :app:installDebug
> IDLE
> IDLE
If I'm using the version as indicated in the docs:
classpath 'com.google.gms:google-services:4.2.0'
I'm getting this error:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Unable to delete directory 'C:\Users\Omer\react-native1\haveri\android\app\build\generated\not_namespaced_r_class_sources\debug\r\androidx' after 10 attempts
* 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 15s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Unable to delete directory 'C:\Users\Omer\react-native1\haveri\android\app\build\generated\not_namespaced_r_class_sources\debug\r\androidx' after 10 attempts
* 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 15s
at makeError (C:\Users\Omer\react-native1\haveri\node_modules\execa\index.js:174:9)
at C:\Users\Omer\react-native1\haveri\node_modules\execa\index.js:278:16
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async runOnAllDevices (C:\Users\Omer\react-native1\haveri\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:5)
at async Command.handleAction (C:\Users\Omer\react-native1\haveri\node_modules\react-native\node_modules\#react-native-community\cli\build\index.js:186:9)
This is all trying to install the react-native-firebase on a brand new project.
What am I doing wrong? How can I install it successfully?
Try running these commands. Then start try to run your app again
cd android
./gradlew clean
Try building Gradle from within Android studio. I found that this overcame some build problems sometimes when integrating with react-native-firebase. From Android studio, open your android project by navigating to your /Android folder in your RN project. Let Gradle start syncing and monitor for any errors details.
You may find that there are some JDK path related issues when launching your Android Studio. Try to troubleshoot any errors reported by Android Studio before building.

My react native project cannot build after rename project

I tried to rename my app because I need it but I got the problem after rename it (it works fine before I rename it). I followed this instruction : https://dev.to/abdulbasit313/proper-way-to-rename-a-react-native-project-in-2019-3b98 but when I run, build failed
I'm using react native 0.59.9
This is the error :
info Starting JS server...
info Building and installing the app on the device (cd android && gradlew.bat app:installDebug)...
> Task :app:preDebugBuild FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:preDebugBuild'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find com.github.yalantis:ucrop:2.2.2-native.
Searched in the following locations:
- file:/C:/Users/ASUS/.m2/repository/com/github/yalantis/ucrop/2.2.2-native/ucrop-2.2.2-native.pom
- file:/C:/Users/ASUS/.m2/repository/com/github/yalantis/ucrop/2.2.2-native/ucrop-2.2.2-native.jar
- https://dl.google.com/dl/android/maven2/com/github/yalantis/ucrop/2.2.2-native/ucrop-2.2.2-native.pom
- https://dl.google.com/dl/android/maven2/com/github/yalantis/ucrop/2.2.2-native/ucrop-2.2.2-native.jar
- https://jcenter.bintray.com/com/github/yalantis/ucrop/2.2.2-native/ucrop-2.2.2-native.pom
- https://jcenter.bintray.com/com/github/yalantis/ucrop/2.2.2-native/ucrop-2.2.2-native.jar
- file:/D:/3-SIMASA/simasamobile/node_modules/react-native/android/com/github/yalantis/ucrop/2.2.2-native/ucrop-2.2.2-native.pom
- file:/D:/3-SIMASA/simasamobile/node_modules/react-native/android/com/github/yalantis/ucrop/2.2.2-native/ucrop-2.2.2-native.jar
Required by:
project :app > project :react-native-image-crop-picker
* 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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 7s
21 actionable tasks: 20 executed, 1 up-to-date
error Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html
error Command failed: gradlew.bat app:installDebug. Run CLI with --verbose flag for more details.
The mentioned solution is not correct because it'll clear your linked libraries... You can easily rename the android project by changing name in android/src/main/res/values/strings.xml. Also on iOS, you can change the name by opening ios/your_project.xcodeproj in Xcode and modify Display Name in the General tab of your project settings.
Please install and relink the library again. This will resolve the issue.
react-native-image-crop-picker
Also please refer here to how to rename project in easier way.