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 … Read more

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 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 it … Read more

Attempt to invoke virtual method ‘ React Native Error Fix

Sometimes, your react native project throws unexpected errors for no reasons. You might be building your app without problems yesterday but not today. Yes, react native is just like that. I faced the following react native error while running one of my react native projects. In words, it says Attempt to invoke virtual method ‘ … Read more

How to use BackHandler with React Navigation in React Native

On Android devices, users prefer hardware back button to navigate back. Even though the actions of the back button is normally 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 API … Read more

How to do API calls in React Native with Axios and Redux

Redux is the most popular application state management library used in react as well as react native apps. In this blog post, I will explain to you how to do API calls or HTTP requests in react native with redux and Axios. Update: Check out my new blog post on how to do API calls … Read more

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 sexy. In this blog post, let’s check how to make an image background for a screen in react native. … Read more

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 a container and it can have any number of children. In this blog post, let’s check how to convert or show View component as different custom shapes such as square, rectangle, circle, triangle etc. … Read more

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 Text Input 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 … Read more