CUSTOM ERRORS
Welcome to React Native! React Native helps you build modern applications.
For getting started an React Native application you needs two things as Prerequisites.
Prerequisites
Before you begin, make sure your development environment includes React Native and install in Android Studio or in Visual Studio
If Any Error Phase like below given the check it out :
- Make sure you have emulator running or real device is connect through USB or wifi.
- Run command adb reverse tcp:8081 tcp:8081
- Again start terminal after successfully running above command.
- Try running command npm install --legacy-peer-deps
- If running above also don't work then only run npm install --force
This error occurs when you attempt to use the manual linking feature (i.e. react-native link and react-native link unlink commands), which have been removed in React Native 0.69 and replaced with autolinking.
[drawable-mdpi-v4/jumper] /Users/admin/Projects/testApp/android/app/src/main/res/drawable-mdpi/jumper.png [drawable-mdpi-v4/jumper] /Users/admin/Projects/testApp/android/app/build/generated/res/react/release/drawable-mdpi-v4/jumper.png: Error: Duplicate resources
:app:mergeReleaseResources FAILED
FAILURE: Build failed with an exception.
...
The build failure occurred because duplicated resources were found in the Android project inside the Android folder. There are various solutions for this depending on the cause.
Solution:
-
Cleaning the drawable folder from the terminal.
Oftentimes you can get rid of the error simply by cleaning the drawable folder from the terminal using Gradle. To do this, cd into the android folder, then run ./gradlew clean before attempting to run the app again:
./gradlew clean