React-native run-android fails with Task 'installDebug' not found in root project 'android'. Some candidates are: 'installDevDebug'


#1

I have followed the instructions here: https://docs.expo.io/versions/latest/guides/expokit.html

I can get Android to build and run properly in Android Studio but not when I run react-native run-android. I get this error:

Task 'installDebug' not found in root project 'android'. Some candidates are: 'installDevDebug'.

I thought this should have been solved after I build and run on Android studio for the first time.


#2

Hi @darkwata - you may not be able to use the vanilla react-native run-android command on an ExpoKit project, as an ExpoKit project has more build flavors than the react-native CLI expects.

If you want to build the project from the command line instead of android studio, you can just run ./gradlew installDevDebug from the /android directory in your project.

Let us know if that still doesn’t work.


#3

Thank you @esamelson !


#4

Hi, @esamelson, is it possible to run ‘react-native run-android’ after detaching to ExpoKit?


#5

Hi @wilbyang - that’s exactly the question that was answered above. You may need to instead run ./gradlew installDevDebug from the /android directory in your project, which will accomplish the same thing as react-native run-android.

(If you’re testing on an Android device older than Android 6, you may need to run ./gradlew installDev19Debug, which is slower but avoids a multidex error on these older platforms.)


closed #6

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.