Fix Build Failed on React-Native run-android
The error says no devices connected.
Means there is no emulator or a device connected to your system.
- If you have an emulator please run it before running react native app. If not please create an emulator first.
Follow this link to create one : create emulator
- If you want to run it on your phone. Attach it with a cable and turn on usb debugging on your phone.
Hope this solves your problem
how can I fix build failed after I run react-native run-android in windows 10
ANDROID_HOME
is Deprecated (in Android Studio), use ANDROID_SDK_ROOT
instead.
Configure the ANDROID_SDK_ROOT
environment variable
- Open the Windows Control Panel.
- Click on User Accounts, then click
User Accounts again - Click on Change my environment variables
- Click on New... to create a new
ANDROID_SDK_ROOT
user variable that points to the path to your Android SDK:
The SDK is installed, by default, at the following location:
%LOCALAPPDATA%\Android\Sdk
You can find the actual location of the SDK in the Android Studio "Settings" dialog, under Appearance & Behavior → System Settings → Android SDK.
npx react-native run-android fails with error
basically gradle-6.3 did the trick. when i set up everything it was 6.2. in gradle-wrapper.properties i had to change 6.2 to 6.3 like this:
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
react-native android project not found error
The issue comes after glob@7.2.2 was released. Follow the following steps and recompile the project.
- Clear node_modules
- add this to package.json
"resolutions": { "glob": "7.2.0" } - Reinstall node_modules with npm install
If this not work try this command
" yarn add glob@7.2.0"
Related Topics
Gradle Implementation VS API Configuration
How to Set Default Font Family For Entire Android App
How to Download and Save an Image in Android
How to Lazy Load Images in Listview in Android
How to Save an Activity State Using the Save Instance State
How to Use Sharedpreferences in Android to Store, Fetch and Edit Values
How to Manage Startactivityforresult on Android
Android Fastboot Waiting for Devices
How to Set Align (Right or Left) of Text in Textview, Programmatically
Aligning Textviews on the Left and Right Edges in Android Layout
Java.Io.Ioexception: Permission Denied Cannot Create File
React Native: Java_Home Is Not Set and No 'Java' Command Could Be Found in Your Path
Open Facebook Page in Facebook App (If Installed) on Android
Access Ro.Serialno from Native in Android 8
Why Does My Button Not Showing in the Layout
How to Retrieve Current Fragment in Navhostfragment