The error message is as follows
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.
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
Error source: my RN code from the company’s computer clone is normal, and the above errors occur in yarn install and yarn Android, both in virtual machine running and real machine running. In order to try and error, I init a project again, and the result is such an error, but I can still run individual RN projects, of course.
Consult the document solution 1:
just start it directly with Android studio and let Android studio automatically integrate some Android environments and then run applications. However, I personally gave up because I was not very proficient in as running Android, but I thought it would be troublesome if I needed to run as every time I created an RN project
Solution 2:
the blogger said that it is necessary to configure the ADB environment. After a review, it is found that almost all the configured Android environments have been configured
%ANDROID_HOME%\platform-tools
%ANDROID_HOME%\emulator
%ANDROID_HOME%\tools
%ANDROID_HOME%\tools\bin
Document review solution 3:
Place the following line in your Android/gradle.properties file:
android.useAndroidX=true
android.enableJetifier=true
What do bloggers mean when they post the above sentence?In fact, the support community is messy. Google launched Android X and gradually shifted its focus and migrated, so our project depends on the package and needs to be migrated
Android. Useandroidx = true indicates that androidx is enabled for the current project. Android. Enablejetifier = true indicates that dependent packages will also be migrated to androidx. If the value is false, it means that the dependent package will not be migrated, but there may be problems when using the content in the dependent package. Of course, if no three-party dependency is used in my project, this item can be set to false
in fact, these two pieces of code were already there when we created the RN project
Solution 4 (feasible):
in fact, I just saw that the blogger posted several strings of English, one of which was
# npx react-native doctor
I knew that the NPX react native doctor command should be similar to the fluent doctor command. Check whether the current running environment meets the requirements
So I ran the command on the command line. I found that the doctor told me that I lacked the java8 environment (in fact, I do have it, but he said that I must lack it) and Android tools 29.2. So I uninstalled java8, reinstalled and reconfigured Java_ Home go to as to download 29.2
just come back and check it again
Read More:
- [Solved] Using `babel-preset-react-app` requires that you specify `NODE_ENV` or `BABEL_ENV` environment variables. Valid values are “development”, “test”, and “production”. Instead, received: undefined.
- Plugin is too old, please update to a more recent version, or set ANDROID_DAILY_OVERRIDE environment
- [Solved] React Native Red screen Error: Unable to load script from assets
- [Solved] Appium Install Error: Original error: Neither ANDROID_HOME nor ANDROID_SDK_ROOT environment variab
- [INS-06006] Passwordless SSH connectivity not set up [Solved]
- [Solved] Android app development version update failed, Android – error: task execution failed ‘: app: com
- [Solved] An error occurred while processing your request…enable the Development environment by setting …
- [Solved] Android Studio Error: ERROR: Cause: executing external native build for cmake
- [Solved] catkin_make Error: Invoking “make -j12 -l12“ failed
- [Solved] Error downloading standard development IDs for MRPC. You will need to manually split your data.
- [Solved] Android Develop Error: xxx does not have a NavController set on xxx
- [Solved] react Error: Can‘t perform a React state update on an unmounted component
- Android Working Directory:NULL Environment:NULL Error
- Failed to create pod sandbox: rpc error: code = Unknown desc = [failed to set up sandbox container…
- [Solved] npm Error: Can‘t find Python executable “python“, you can set the PYTHON env variable.
- [Solved] Install nginx make & make install error report record
- org/sqlite/native/Mac/aarch64 Error [How to Solve]
- [Solved] Android Studio Start Error: Missing essential plugin: org.jetbrains.android Please reinstall Android
- React Hook “useState“ is called in function “xxx“ which is neither a React function component or
- [Solved] Android Error: import android.support.annotation.NonNull