Android Studio的安装详细步骤
Android Studio的安装需要使用到Gradle,JDK,甚至是maven
目录
安装的第一步:
第二步 安装gradle(最好对应Android studio的gradle版本)
第三步 安装Android Studio
第四步 随便创建一个 有activity的项目(路径没有中文)
安装的第一步:
卸载原有的Android Studio

如上图所示的步骤卸载原来的 Android Studio,还原原来的安装模式
第二步 安装gradle(最好对应Android studio的gradle版本)
国内镜像地址腾讯仓库
https://mirrors.cloud.tencent.com/gradle/
下载解压后
放到路径无中文的任何位置
配置环境变量
GRADLE_PATH
复制这路径

添加到





此时还没有.gradle
进入dom窗口
相当于初始化gradle


添加初始化脚本(全局使用的),为了解决由于gradle的下载以及访问外网的速度,实际上就是使用国内镜像网站下载资源,因为国内因素访问外网都是很慢的。这导致很多人安装都会失败。
init.gradle
allprojects {
buildscript {
repositories {
maven { url 'https://maven.aliyun.com/repository/public/' }
maven { url 'https://maven.aliyun.com/repository/google/' }
}
}
repositories {
maven { url 'https://maven.aliyun.com/repository/public/' }
maven { url 'https://maven.aliyun.com/repository/google/' }
}
println "${it.name}: Aliyun maven mirror injected"
}

第三步 配置好之前的idea
你会发现 idea默认配置maven的配置文件在这里

这里是因为我之前就配置好了,没有的话
自己自行配置

这里主要配置本地仓库 以及 maven包的下载地址(科学上网除外),使用国内镜像
H:\apache-maven-3.8.6-bin\apache-maven-3.8.6\localRepository
<!-- interactiveMode
| This will determine whether maven prompts you when it needs input. If set to false,
| maven will use a sensible default value, perhaps based on some other setting, for
| the parameter in question.
|
| Default: true
true
-->
<!-- offline
| Determines whether maven should attempt to connect to the network when executing a build.
| This will have an effect on artifact downloads, artifact deployment, and others.
|
| Default: false
false
-->
<!-- pluginGroup
| Specifies a further group identifier to use for plugin lookup.
com.your.plugins
-->
<!-- proxy
| Specification for one proxy, to be used in connecting to the network.
|
optional
true
http
proxyuser
proxypass
proxy.host.net
80
local.net|some.host.com
-->
<!-- server
| Specifies the authentication information to use when connecting to a particular server, identified by
| a unique name within the system (referred to by the 'id' attribute below).
|
| NOTE: You should either specify username/password OR privateKey/passphrase, since these pairings are
| used together.
|
deploymentRepo
repouser
repopwd
-->
<!-- Another sample, using keys to authenticate.
siteServer
/path/to/private/key
optional; leave empty if not used.
-->
alimaven
aliyun maven
central
http://maven.aliyun.com/nexus/content/repositories/central/
repo1
central
Human Readable Name for this Mirror.
http://repo1.maven.org/maven2/
repo2
central
Human Readable Name for this Mirror.
http://repo2.maven.org/maven2/
<!-- mirror
| Specifies a repository mirror site to use instead of a given repository. The repository that
| this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
| for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
|
mirrorId
repositoryId
Human Readable Name for this Mirror.
http://my.repository.com/repo/path
-->
<!--
maven-default-http-blocker
external:http:*
Pseudo repository to mirror external repositories initially using HTTP.
http://0.0.0.0/
true
-->
<!-- profile
| Specifies a set of introductions to the build process, to be activated using one or more of the
| mechanisms described above. For inheritance purposes, and to activate profiles via
| or the command line, profiles have to have an ID that is unique.
|
| An encouraged best practice for profile identification is to use a consistent naming convention
| for profiles, such as 'env-dev', 'env-test', 'env-production', 'user-jdcasey', 'user-brett', etc.
| This will make it more intuitive to understand what the set of introduced profiles is attempting
| to accomplish, particularly when you only have a list of profile id's for debug.
|
| This profile example uses the JDK version to trigger activation, and provides a JDK-specific repo.
jdk-1.4
1.4
jdk14
Repository for JDK 1.4 builds
http://www.myhost.com/maven/jdk14
default
always
-->
<!--
| Here is another profile, activated by the system property 'target-env' with a value of 'dev',
| which provides a specific path to the Tomcat instance. To use this, your plugin configuration
| might hypothetically look like:
|
| ...
|
| org.myco.myplugins
| myplugin
|
|
| ${tomcatPath}
|
|
| ...
|
| NOTE: If you just wanted to inject this configuration whenever someone set 'target-env' to
| anything, you could just leave off the inside the activation-property.
|
env-dev
target-env
dev
/path/to/tomcat/instance
-->
<!-- activeProfiles
| List of profiles that are active for all builds.
|
alwaysActiveProfile
anotherAlwaysActiveProfile
-->
这里有些细节 可以自寻maven的配置
第四步 安装Android Studio
首先访问
Download Android Studio & App Tools – Android Developers
这是Android Studio的国内官方下载地址
下载完成后
安装








这里是我的jdk的放置位置

这里由于我之前已经下好了sdk的缘故,如果没有sdk的话,需要放置到路径没有中文的文件夹下


需要接受的都得接受


等待下载完成后(大约1小时)


第四步 随便创建一个 有activity的项目(路径没有中文)


gradle开始下载 资源

这里会出现下载中断报错的原因
这里就需要重新构建
也就是重新下载资源
这里你会发现使用的是阿里云的仓库下载资源

所有资源下载完成

这里可以选择usb连接手机或者虚拟手机使用


这里是运行成功的效果

本文来自网络,不代表协通编程立场,如若转载,请注明出处:https://net2asp.com/3301bbaab2.html
