React native Task 'installDebug' not found in project ':app' when run-android - react-native

I jus started to setup development environment for react-native-cli. I was followed the instruction on the document on this link:
https://reactnative.dev/docs/environment-setup
but i got error message when i start to run my sample project.
I got this message: Task 'installDebug' not found in project ':app' when i executed this command: 'react-native run android'.
what can i do to solved this error.
thx

Opening android directory in Android Studio and building there does the trick.

Related

A problem occurred configuring project ':#sentry_react-native' SDK location not found

I'm on MacOS trying to run a react native (0.59.9) app on Android emulator. I've integrated Sentry using the wizard. Works fine on iPhone. On Android, this happens:
I try to run the app w/ react-native run-android
Build fails.
A problem occurred configuring project ':#sentry_react-native'.
SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
I go into the android folder and create a local.properties file and paste this in:
sdk.dir=C:/Users/my_name/Library/Android/sdk
I try again to run the app w/ react-native run-android
Build fails.
A problem occurred configuring project ':#sentry_react-native'.
The SDK directory '/Users/my_name/project_path/android/C:/Users/my_name/Library/Android/sdk' does not exist.
Why is it concatenating the SDK dir w/ my project path? That doesn't make sense to me. How do I fix this?
this isn't a Sentry issue, but an Android environment issue, please look at https://reactnative.dev/docs/getting-started.html and set your Android env. properly.
Look for "Android development environment", good luck :)

react native gradlew assembleRelease failed to execute appt

First stacktrace:
I am trying to produce an apk to my project but it always fail and produce the errors in the pictures
Please Help
Second stacktrace:
I think you can try by use Android Studio open android project inside react native and clean so build by Android Studio. This way work for me. I just can use gradle build command after update/reinstall Android Studio

React native error install failed already exists

I just started working with react native. I created a new project using
react-native init ChatSample.
Then i run this command
react-native run-android --deviceId MYDEVICEID
Now after finishing 100% it shows this error
adb: failed to install app/build/outputs/apk/app-debug.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install com.chatsample without first uninstalling.]
I moved to this folder and found that app-debug.apk exists there so i deleted it, but again when i run this command it shows same error.
Then i deleted the complete build folder and run this command but still got the same error. More precisely when it is around 50% it starts creating build folder and app-debug.apk and as soon as it reaches 100% app-debug.apk file is created in that folder. But why is the error coming, like this is a fresh project and all i did is just run two command first for creating project and other for running app.
You can open the project in Android Studio from the ProjectFile/android. Then build and run on your Phone
Is in your device the APK installed? Try uninstalling the APK from the device and then run the command again.

Integrate viro-react into react-native project

Anyone here managed to integrate viro-react into react-native project? I followed the instruction in
the documentation
After that, I executed the project but not able to run.
This is the error that I got
Even though I run with gradlew installOvrDebug, still it failed.
If your configurations are correct then try running with any of these variants
ArDebug, GvrDebug or OvrDebug
Example running apllication with Augmented Reality:
Android
react-native run-android --variant=ArDebug
iOS
react-native run-ios --variant=ArDebug
I solved this problem with the following method:
Go to the Navigate to the node_modules/react-native/local-cli/runAndroid/runAndroid.js file and edit the lines that include installDebug change it to installArDebug
Go to the terminal and npm start
Open another terminal and react-native run-android
*Make sure that your device is plugged in and that you have android studio sdk paths in your environment variables. This should do the trick!

Unable to run react-native release build

I am trying to deploy my react-native app to android. I follow the steps on this page
https://facebook.github.io/react-native/docs/signed-apk-android.html.
When I try to run it, it tells me
not such file or directory '.../assets/index.android.bundle'
or I get
Task 'installReleaseDebug' not found in root project 'awezaEduApp'
Using Windows 10 and react-native 0.39.2
OUTCOME
I ended up having to reformat my laptop for other reasons and when i repeated the signing process it worked. On account of my previous efforts, prior to reformatting, I would presume that Eldelshell's answer would have solved it.
Note: I think that running gradle tasks in Android Studio's terminal would also work.
You need to execute react-native run-android at least once. Don't worry if it fails because you don't have the emulator running.
or I get Task 'installReleaseDebug' not found in root project 'awezaEduApp'
You have to execute gradle inside the android folder.
Task 'installReleaseDebug' not found in root project 'awezaEduApp'
For RN 0.39.x, you have to run the following for release build:
react-native run-android --configuration=release