Common problems during Android Studio installation

1. Questions about the download address
https://developer.android.google.cn/
https://www.androiddevtools.cn/

2. Questions about the version
are consistent with the number of digits of the operating system

3. Is it the installation version or the decompression version? The
installation version can automatically install AS software components and configure system environment variables at the same time. The decompressed version also needs to configure environment variables by itself, which is troublesome.

4. Several important components of AS
AS development platform: different versions and
sizes, about 1-2G , preferably not on the C drive .
Simulator: Generally, it will be automatically created under the current user. A complete simulator is about 10G, so build as few simulators as possible; in addition, there are some third-party simulators, such as Ye Shen. If the AS built-in simulator has problems, you can use a third-party simulator.
Temporary files: files created automatically by the system, about several hundred megabytes.

5. Chinese path problem
The installation directory of AS does not support Chinese.

6. The problem that the emulator cannot run.
If the run button is gray,
it may be the following problems:
1) Generally, the SDK is not installed or there is a problem with the system path.
2) There is an error in the program
. 3) It may also be a problem that the version does not correspond. Same problem with com.android.support:appcompat-v7:29.+.

7. When creating a new project in Android Studio, Gradle loads slowly. Go
to https://services.gradle.org/distributions/ and download the required version of gradle in advance through Thunder, such as gradle-6.1.1-all.zip, put Copy gralde-6.1.1-all.zip to C:\Users\Lenovo.gradle\wrapper\dists\gradle-6.1.1-all\cfmwm155h49vnt3hynmlrsdst (the last directory is automatically generated by the system), restart AS.

8. "Multiple Gradle daemons might be spawned because the Gradle JDK and JAVA_HOME locations are different. Project 'My Application' is using the following JDK location when running Gradle: 'D:/Android Studio/jbr' The system environment variable JAVA_HOME is: 'C:\Program Files\Java\jdk-11.0.16' If you dont need to use different paths (or if JAVA_HOME is undefined), you can avoid spawning multiple daemons by setting JAVA_HOME and the JDK location to the same path." Code error
The reason for this problem is that the JDK used in the Android Studio development environment is inconsistent with the JDK used in the global environment. Just set the JDK used in the Android Studio development environment to the JDK used in the global environment.

9. Emulator: PANIC: Cannot find AVD system path. Please define ANDROID_SDK_ROOT problem
First close the AS environment
and delete all images in the AVD. Set in the system environment variable Add
insert image description here
a new ANDROID_SDK_HOME environment variable.
Then restart Android Studio to make the environment variables take effect.
Open Tools->AVD Manager again to install a mirror and start it.

10. Waiting for Target Device to Come Online problem
The following interface appears during operation:
insert image description here

Method 1
Delete the emulator file in the C:\Users\Admin.android\avd directory, and then create a new emulator.

Method 2
insert image description here
Note: If the above method has not solved the problem, you can use a third-party simulator, such as Ye Shen.

11. A VT-x prompt appears when the Android Studio emulator is running, and the emulator cannot be opened

This problem may be encountered in desktops and notebooks. The following is an introduction based on the content of the reference website, taking the problems encountered in desktops as an example to introduce the occurrence and solution of VT-x problems. When opening the emulator that comes with Android Studio, there is a problem: vt-x is disabled in BIOS. It turns out that the switch that supports emulator operation in the system BIOS is turned off.
insert image description here

Then we need to enter the BIOS of the Windows 10 system. Due to the optimized startup of the Windows 10 system, it is impossible to enter the B10S directly by clicking F2 or other trigger keys, so we need to do some settings before this: 1. Turn on the
system Control Panel, click "Hardware and Sound"
2. Click "Power Options"
3. Click "Choose what the power buttons do"
4. Click "Change settings that are currently unavailable"
5. Uncheck "Enable Fast Startup"
6. To After this step, the system setting is completed, then restart the computer, and click F2 to enter the BIOS when restarting.
7. Click F3 to enter the CPU configuration page.
8. Scroll down to find "Intel Visualization Technology" and set it to "enable".
9. Click F10 to save and click Enter to exit BIOS and start Windows.
10. Open Android Studio again after the above steps, and find that the previous prompt information is gone, and click the start button of the emulator to start normally.
11. You're done, remember to turn on the "Enable Fast Startup" that was turned off in the control panel before.

12. There are two ways to run an Android project, one is to test with a real device, the other is to use an emulator (built-in or a third party)
1. For a real device test, take Mi 8 as an example,
USB connection -> Settings -> More Settings -> Developer Options -> Enable Developer Options -> Allow USB Debugging. After connecting together, you can see the real device in AS, as shown in the figure below: Click the run button to see the APP running on the
insert image description here
phone interface.
If the operation is not successful, turn off "Enable MIUI Optimization" in the developer options and run it again.

2.
If the emulator is Intel, you need to install the HAXM plug-in (which can be accelerated).
If it is AMD, you need to use two software, Oracle VM VirtualBox virtual machine, Genymotion emulator, installation configuration reference https://space.bilibili.com/ 475614548 . You need to enable cpu virtualization in the bios settings.
Third-party simulators, such as Night God.

Guess you like

Origin blog.csdn.net/qq_55795222/article/details/129880806