Article directory
1. Environment construction
1.1 Installation path
windows:https://redirector.gvt1.com/edgedl/android/studio/install/2022.3.1.18/android-studio-2022.3.1.18-windows.exe
mac arm:https://redirector.gvt1.com/edgedl/android/studio/install/2022.3.1.18/android-studio-2022.3.1.18-mac_arm.dmg
1.2 mac arm
On the mac, use uname -a in the terminal to check whether the mac is arm64.
1.3 install android studio
cmd line tools
2. Install the sdk
Opening android studio may prompt that the sdk cannot be found. Don't worry, click next first, and then you can turn off the proxy in the setting and then turn it on again.
default path
/Users/youkai/Library/Android/sdk
Encountered a problem: the sdk cannot be installed. I uninstalled it before, and I deleted the directory under the sdk.
3. Update sdk
3.1 Turn off the proxy
Plugins – setting – HTTP Proxy setting – No proxy
needs to close the proxy first, then close stduio, and then reopen it to install
3.2 re-update sdk
After that, it can be automatically updated, and the update results are as follows
4. Update the api
Depending on your project requirements, android12 is 31, android13 is 33.
5. Project creation
Six, gradle installation
The gradle will be automatically obtained when the project is created, and the download is easy to disconnect. You can download the gradle yourself, and then configure the local path, instead of downloading it from the Internet every time.
https://www.jianshu.com/p/c0718c34060a
Installation URL: https://services.gradle.org/distributions/
build.gradle.kts: https://www.jianshu.com/p/7d37f899d37c
By default, the gradle downloaded from the Internet is used. Since the download is easy to be interrupted, you can directly use the local file after downloading and put it
in the local directory, and then drag the folder to the terminal to see the path.
gradle-wrapper.properties
distributionUrl=file:///Volumes/youkai_data/android_pro/gradle/gradle-8.0-bin.zip
Seven, avd
I have downloaded it, and if I haven't downloaded it, click the download button next to Tiramisu.
8. Problem: missing build tools
Prompt can not find build tools 33.0.1
By default, only 34 will be downloaded, and all package information needs to be displayed, just select the corresponding tools
Nine, compile and run
summary
So far, the project can be successfully created, compiled and run.
The development on mac is quite smooth.