Error: spawnSync ./gradlew EACCES React Native Error Fix

I was trying to run one of my react native projects on the Android emulator and faced the following error. Error: spawnSync ./gradlew EACCES at Object.spawnSync (internal/child_process.js:1041:20) at spawnSync (child_process.js:607:24) at execFileSync (child_process.js:634:15) at runOnAllDevices (/home/rashid/Desktop/React Native/Tomorrow/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:74:39) at buildAndRun (/home/rashid/Desktop/React Native/Tomorrow/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:158:41) at /home/rashid/Desktop/React Native/Tomorrow/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:125:12 at processTicksAndRejections (internal/process/task_queues.js:85:5) at async Command.handleAction (/home/rashid/Desktop/React Native/Tomorrow/node_modules/react-native/node_modules/@react-native-community/cli/build/cliEntry.js:160:7) My PC runs…

How to Detect React Native App is in Background

Sometimes, you may want to know whether your react native app is running background or running foreground to execute your tasks. You can use the AppState API from react native for this purpose. If the AppState.currentState is active then it means your app is running in the foreground whereas if the AppState.currentState is background then…

How to use BackHandler with React Navigation in React Native

On Android devices, users prefer the hardware back button to navigate back. Even though the actions of the back button are generally desirable, sometimes you may need to customize the action of the hardware button. In this blog post, Let’s see how to customize the back button actions using BackHandler and react-navigation library. The BackHandler…

How to set Image as Background for a Screen in React Native

The mobile app user interface should be made beautiful to attract the attention of its users. In some scenarios, setting an image as the background for a screen can make the app looks more appealing, and cool. In this blog post, let’s check how to make an image background for a screen in react native….

How to Convert View into Custom Shapes like Square, Rectangle, Circle and Triangle

A View is the most fundamental component for building the user interface of a React Native mobile app. The View acts as a container and it can have any number of children. In this blog post, let’s check how to convert or show View components as different custom shapes such as square, rectangle, circle, triangle,…

How to Add or Remove TextInput Dynamically and get Values in React Native

In this blog post, I am going to write about how to dynamically add or remove the TextInput component and get corresponding values from each text input in react native. In this react native dynamic TextInput example, I have three buttons namely add, remove and get values. Pressing add button will add a TextInput component…

How to Add a Material Design Dropdown in React Native Compatible for both iOS and Android

Picker component of react native is used for showing drop down menu in apps. If you are not satisfied with the picker component then you can use react native material dropdown component which works well on both Android and iOS platforms. The drop down component follows material design with ripple effects. You can install react…

‘ERROR: Running multiple emulators with the same AVD is an experimental feature’ Android Emulator Error Fix

As a react native user, I prefer to run android emulator using the command line. Thus, I can avoid opening Android Studio. Sometimes, I can’t run the emulator as I face the following Android emulator error: emulator: ERROR: Running multiple emulators with the same AVD is an experimental feature. Please use -read-only flag to enable…

com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives React Native Error Fix

I came across this react native error when I tried to run my react native project with react-native run-android command after adding a third party library which made native changes. Here’s the error which caused the failure of the app build:java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Error while merg ing dex archives: The number of method references in…