React native environment construction please: react native environment construction
Here's the react native. After the creation is complete, the common problems that appear in the run
Question 1:
Java.lang.RuntimeException:SDK location is not found. Define location with Sdk.dir in the Local.properties file or with an android_home environment variable.
This is because the project can't find our Android SDK.
workaround: Create a new Local.properties file under the Android file in the project's root directory (we can directly copy the Android project local.properties file ).
Question 2:
A problem occurred configuring project ': App '. >failed to find Build Tools revision 23.0.1
This is due to the inconsistency between build Tools revision 23.0.1 and the version in our SDK.
workaround: Note the correspondence between gradle-wrapper.properties in Build.gradle and Gradle.
3,could not install the app on the device and read the error above for details.
This is because the device that is running is not found
Workaround: Note Before you run the command: react-native run-android Make sure that the phone is connected to the computer.
4,com.android.ddmlib.installexception:failed to establish session
This is the Xiaomi phone debugging problems, I used Meizu before this problem
Workaround: -------developer options in Xiaomi Phone settings---------enable MIUI optimization off
React Common mistakes in the development of native