Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

After expo eject : Task 'installDebug' not found in root project 'android' #4097

Closed
HyperNovax opened this issue Apr 30, 2019 · 1 comment
Closed
Labels

Comments

@HyperNovax
Copy link

馃悰 Bug Report

Environment

Expo CLI 2.11.3 environment info:
System:
OS: Windows 10
Binaries:
Yarn: 1.13.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.8.0 - C:\Program Files\nodejs\npm.CMD
IDEs:
Android Studio: Version 3.4.0.0 AI-183.5429.30.34.5452501

I created an application with expo init. I developped with expo and now I would like build without sending the source on expo server. So I ejected my application with expo eject (ExpoKit).

Steps to Reproduce

You can reproduce the problem with these commands :
expo init NewProject (blank or tabs)
expo eject (choose ExpoKit)
react-native run-android

First problem : gradlew.bat is missing in the android directory. I copy this file from a react-native init new project.

Expected Behavior

I expect a build success or an another error which would mean that I am unlocked.

Actual Behavior

I have this error :

What went wrong: 
Task 'installDebug' not found in root project 'android'.

Try:
Run gradlew tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

Get more help at https://help.gradle.org

In directory android I use this command gradlew tasks and I have that :

Install tasks
-------------
installDevKernelDebug - Installs the DebugDevKernel build.
installDevKernelDebugAndroidTest - Installs the android (on device) tests for the DevKernelDebug build.
installProdKernelDebug - Installs the DebugProdKernel build.
installProdKernelDebugAndroidTest - Installs the android (on device) tests for the ProdKernelDebug build.
uninstallAll - Uninstall all applications.
uninstallDevKernelDebug - Uninstalls the DebugDevKernel build.
uninstallDevKernelDebugAndroidTest - Uninstalls the android (on device) tests for the DevKernelDebug build.
uninstallDevKernelRelease - Uninstalls the ReleaseDevKernel build.
uninstallProdKernelDebug - Uninstalls the DebugProdKernel build.
uninstallProdKernelDebugAndroidTest - Uninstalls the android (on device) tests for the ProdKernelDebug build.
uninstallProdKernelRelease - Uninstalls the ReleaseProdKernel build.

When I create a react-native application I don't have this problem.

Install tasks
-------------
installDebug - Installs the Debug build.
installDebugAndroidTest - Installs the android (on device) tests for the Debug build.
uninstallAll - Uninstall all applications.
uninstallDebug - Uninstalls the Debug build.
uninstallDebugAndroidTest - Uninstalls the android (on device) tests for the Debug build.
uninstallRelease - Uninstalls the Release build.
@HyperNovax
Copy link
Author

I resolve my problem.

Step 1 :

Don't use react-native run-android.

Step 2 :

Copy file gradlew.bat from an another react-native project.

Step 3 :

In directory /android execute the command gradlew tasks.

Check the commands that can be used in Install tasks

Install tasks
-------------
installDevKernelDebug - Installs the DebugDevKernel build.
installDevKernelDebugAndroidTest - Installs the android (on device) tests for the DevKernelDebug build.
installProdKernelDebug - Installs the DebugProdKernel build.
installProdKernelDebugAndroidTest - Installs the android (on device) tests for the ProdKernelDebug build.
uninstallAll - Uninstall all applications.
uninstallDevKernelDebug - Uninstalls the DebugDevKernel build.
uninstallDevKernelDebugAndroidTest - Uninstalls the android (on device) tests for the DevKernelDebug build.
uninstallDevKernelRelease - Uninstalls the ReleaseDevKernel build.
uninstallProdKernelDebug - Uninstalls the DebugProdKernel build.
uninstallProdKernelDebugAndroidTest - Uninstalls the android (on device) tests for the ProdKernelDebug build.
uninstallProdKernelRelease - Uninstalls the ReleaseProdKernel build.

Use the command gradlew installDevKernelDebug.

The application will be installed on the mobile.

Step 4 :

Go in the root directory and expo start.
In the browser go to http://localhost:19002.
Select the local connection and recover the value like
expXXXXXXXXXXXXXXXXXXX://127.0.0.1:19000.

Check the file on <NameProject>\android\app\src\main\java\host\exp\exponent\generated\DetachBuildConstants.java and copy the value in DEVELOPMENT_URL variable.

Step 5 :

Exit Metro Bundler with CTRL+C on the console.
Use gradlew installDevKernelDebug in the android directory.
After the build go in root directory and use expo start.

To finish start the application on device.

Voila !

@lock lock bot added the outdated label Oct 28, 2019
@lock lock bot locked and limited conversation to collaborators Oct 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants