react-native: Task 'installDebug' not found in project ':app'. Some candidates are: 'installDevDebug', 'installQaDebug', 'installUaDebug'.
React Native version:
System:
OS: macOS High Sierra 10.13.6
CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
Memory: 195.18 MB / 16.00 GB
Shell: 5.3 - /bin/zsh
Binaries:
Node: 11.10.1 - /usr/local/bin/node
Yarn: 1.10.1 - /usr/local/bin/yarn
npm: 6.7.0 - /usr/local/bin/npm
Watchman: 4.7.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
Android SDK:
API Levels: 23, 25, 26, 27, 28
Build Tools: 23.0.1, 26.0.2, 27.0.3, 28.0.3
System Images: android-28 | Google Play Intel x86 Atom
IDEs:
Android Studio: 3.4 AI-183.5429.30.34.5452501
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.6 => 16.8.6
react-native: 0.60.4 => 0.60.4
npmGlobalPackages:
react-native-cli: 2.0.1
react-native-git-upgrade: 0.2.7
Steps To Reproduce
- git clone from repo: https://github.com/ldco2016/NFIBEngage
npm install
react-native run-android
Describe what you expected to happen:
For the android
version of the app to continue to build as before when running react-native run-android
Snack, code example, screenshot, or link to a repository:
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 49 (4 by maintainers)
Ahh, so is there a flag I need to add so that it runs
installDevDebug
or one of the other flavors?By the way I just did a
./gradlew installDevDebug
and that built successfully.Ha! I just ran
react-native run-android --variant=DevDebug
and it also built successfully!@dulmandakh , thank you for walking me through this. You shed light on some details I was not aware of.
Hey there!
I have solved this problem You just need to make 1 file in Android Folder so
Go android folder
Make file local.properties
then just add this code in local.properties file:-
If MacBook then sdk.dir=/Users/username/Library/android/sdk
if Windows then sdk.dir=C:\Users\UserName\AppData\Local\Android\sdk
if Linux then sdk.dir = /home/USERNAME/Android/sdk
if you want to know what is your system USERNAME then just use command for Mac whoami
and then just rerun command react-native run-android
Thanks š
Running
./gradlew tasks
before runningreact-native run-android
again seemed to do the trick for me, for some reason.Hi @mgoral2. I opened the android folder in AndroidStudio and to run the project. After that, you can use the react-native CLI without this errors.
I cloned the repo, and it builds just fine. It looks like you defined variants in build.gradle. Please check your config.
i had the same issue in fresh react-native project (
react-native init projectname
) after runningreact-native start
thenreact-native run-android
in VS code. It is inRN "0.62.1"
Solution:- i open Android Studio, then clean and rebuild.
I am not sure would it work after clean and rebuild.
i also did and gave the sdk path in root project
Then it works.
My npm version 6.7.0 My Node version v11.10.1 react-native-cli: 2.0.1 react-native: 0.62.1
Thanks @SkariDamm my project is running
I tried this:
do ensure there exists a local.properties file in yout android foler ( MAC nd LINUX users only ) which contains the information regarding ur sdk location sdk.dir = /home/shubham/Android/Sdk
Worked for me on Windows:
Using / instead of \ on sdk.dir.
android/local.properties
sdk.dir=D:/Android/Sdk
I used
npx react-native init name-project
, but it still got error. Steps below worked for me.You might need to navigate to the android folder within your project.
I fixed mine by running this command below.
react-native run-android --variant PRODUCTFLAVORDebug --appIdSuffix PRODUCTFLAVOR
npx react-native doctor
spot the issues and fix themWell, to be clear I am not running
installDebug
, I just runreact-native run-android
same as you did when that error appears. Is there a flag I should be adding toreact-native run-android
command?for me create file local.properties in /android/ folder with sdk.dir=/Users/yes.skyscrapers/Library/Android/sdk path to ur sdk
I did everything from beginning from this tutorial and it works now: https://reactnative.dev/docs/environment-setup
Earlier I was setting up with some YT tutorial which doesnāt mention some steps
export ANDROID_SDK_ROOT=~/Android/Sdk
Solved the problem for me on Linux. Try replacing with your Android SDK path.I was facing the same issue. Adding
ANDROID_HOME
environment variable and addingplatform-tools
directory toPATH
fixed theinstallDebug
related issue for me. You also might need to setJAVA_HOME
environment variable pointing to theJDK installation directory