Android Studio的安装详细步骤

这篇具有很好参考价值的文章主要介绍了Android Studio的安装详细步骤。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

Android Studio的安装需要使用到Gradle,JDK,甚至是maven

目录

安装的第一步:

第二步  安装gradle(最好对应Android studio的gradle版本)

 第三步 安装Android Studio

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


安装的第一步:

卸载原有的Android Studio

android studio安装,软件安装,android studio,android,gradle

如上图所示的步骤卸载原来的 Android Studio,还原原来的安装模式

第二步  安装gradle(最好对应Android studio的gradle版本)

国内镜像地址腾讯仓库https://mirrors.cloud.tencent.com/gradle/

下载解压后

放到路径无中文的任何位置

配置环境变量

 GRADLE_PATH

复制这路径 

android studio安装,软件安装,android studio,android,gradle

添加到

android studio安装,软件安装,android studio,android,gradle

 android studio安装,软件安装,android studio,android,gradle

 android studio安装,软件安装,android studio,android,gradle

 android studio安装,软件安装,android studio,android,gradle

android studio安装,软件安装,android studio,android,gradle

此时还没有.gradle

 进入dom窗口

相当于初始化gradle 

android studio安装,软件安装,android studio,android,gradle

android studio安装,软件安装,android studio,android,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"
}

android studio安装,软件安装,android studio,android,gradle

第三步  配置好之前的idea

你会发现 idea默认配置maven的配置文件在这里 

 

android studio安装,软件安装,android studio,android,gradle

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

自己自行配置

android studio安装,软件安装,android studio,android,gradle

这里主要配置本地仓库 以及 maven包的下载地址<localRepository>(科学上网除外),使用国内镜像<mirrors>

 

<?xml version="1.0" encoding="UTF-8"?>

<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
-->

<!--
 | This is the configuration file for Maven. It can be specified at two levels:
 |
 |  1. User Level. This settings.xml file provides configuration for a single user,
 |                 and is normally provided in ${user.home}/.m2/settings.xml.
 |
 |                 NOTE: This location can be overridden with the CLI option:
 |
 |                 -s /path/to/user/settings.xml
 |
 |  2. Global Level. This settings.xml file provides configuration for all Maven
 |                 users on a machine (assuming they're all using the same Maven
 |                 installation). It's normally provided in
 |                 ${maven.conf}/settings.xml.
 |
 |                 NOTE: This location can be overridden with the CLI option:
 |
 |                 -gs /path/to/global/settings.xml
 |
 | The sections in this sample file are intended to give you a running start at
 | getting the most out of your Maven installation. Where appropriate, the default
 | values (values used when the setting is not specified) are provided.
 |
 |-->
<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 https://maven.apache.org/xsd/settings-1.2.0.xsd">
  <!-- localRepository
   | The path to the local repository maven will use to store artifacts.
   |
   | Default: ${user.home}/.m2/repository
  -->
  <localRepository>H:\apache-maven-3.8.6-bin\apache-maven-3.8.6\localRepository</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
  <interactiveMode>true</interactiveMode>
  -->

  <!-- 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
  <offline>false</offline>
  -->

  <!-- pluginGroups
   | This is a list of additional group identifiers that will be searched when resolving plugins by their prefix, i.e.
   | when invoking a command line like "mvn prefix:goal". Maven will automatically add the group identifiers
   | "org.apache.maven.plugins" and "org.codehaus.mojo" if these are not already contained in the list.
   |-->
  <pluginGroups>
    <!-- pluginGroup
     | Specifies a further group identifier to use for plugin lookup.
    <pluginGroup>com.your.plugins</pluginGroup>
    -->
  </pluginGroups>

  <!-- proxies
   | This is a list of proxies which can be used on this machine to connect to the network.
   | Unless otherwise specified (by system property or command-line switch), the first proxy
   | specification in this list marked as active will be used.
   |-->
  <proxies>
    <!-- proxy
     | Specification for one proxy, to be used in connecting to the network.
     |
    <proxy>
      <id>optional</id>
      <active>true</active>
      <protocol>http</protocol>
      <username>proxyuser</username>
      <password>proxypass</password>
      <host>proxy.host.net</host>
      <port>80</port>
      <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
    </proxy>
    -->
  </proxies>

  <!-- servers
   | This is a list of authentication profiles, keyed by the server-id used within the system.
   | Authentication profiles can be used whenever maven must make a connection to a remote server.
   |-->
  <servers>
    <!-- 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.
     |
    <server>
      <id>deploymentRepo</id>
      <username>repouser</username>
      <password>repopwd</password>
    </server>
    -->

    <!-- Another sample, using keys to authenticate.
    <server>
      <id>siteServer</id>
      <privateKey>/path/to/private/key</privateKey>
      <passphrase>optional; leave empty if not used.</passphrase>
    </server>
    -->
  </servers>

  <!-- mirrors
   | This is a list of mirrors to be used in downloading artifacts from remote repositories.
   |
   | It works like this: a POM may declare a repository to use in resolving certain artifacts.
   | However, this repository may have problems with heavy traffic at times, so people have mirrored
   | it to several places.
   |
   | That repository definition will have a unique id, so we can create a mirror reference for that
   | repository, to be used as an alternate download site. The mirror site will be the preferred
   | server for that repository.
   |-->
   <!-- 阿里云仓库 -->
  <mirrors>
  <mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<mirrorOf>central</mirrorOf>
<url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
</mirror>
<!-- 中央仓库1 -->
<mirror>
    <id>repo1</id>
    <mirrorOf>central</mirrorOf>
    <name>Human Readable Name for this Mirror.</name>
    <url>http://repo1.maven.org/maven2/</url>
</mirror>

<!-- 中央仓库2 -->
<mirror>
    <id>repo2</id>
    <mirrorOf>central</mirrorOf>
    <name>Human Readable Name for this Mirror.</name>
    <url>http://repo2.maven.org/maven2/</url>
</mirror>
    <!-- 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.
     |
    <mirror>
      <id>mirrorId</id>
      <mirrorOf>repositoryId</mirrorOf>
      <name>Human Readable Name for this Mirror.</name>
      <url>http://my.repository.com/repo/path</url>
    </mirror>
     -->
    <!-- <mirror>
      <id>maven-default-http-blocker</id>
      <mirrorOf>external:http:*</mirrorOf>
      <name>Pseudo repository to mirror external repositories initially using HTTP.</name>
      <url>http://0.0.0.0/</url>
      <blocked>true</blocked>
    </mirror> -->
  </mirrors>

  <!-- profiles
   | This is a list of profiles which can be activated in a variety of ways, and which can modify
   | the build process. Profiles provided in the settings.xml are intended to provide local machine-
   | specific paths and repository locations which allow the build to work in the local environment.
   |
   | For example, if you have an integration testing plugin - like cactus - that needs to know where
   | your Tomcat instance is installed, you can provide a variable here such that the variable is
   | dereferenced during the build process to configure the cactus plugin.
   |
   | As noted above, profiles can be activated in a variety of ways. One way - the activeProfiles
   | section of this document (settings.xml) - will be discussed later. Another way essentially
   | relies on the detection of a system property, either matching a particular value for the property,
   | or merely testing its existence. Profiles can also be activated by JDK version prefix, where a
   | value of '1.4' might activate a profile when the build is executed on a JDK version of '1.4.2_07'.
   | Finally, the list of active profiles can be specified directly from the command line.
   |
   | NOTE: For profiles defined in the settings.xml, you are restricted to specifying only artifact
   |       repositories, plugin repositories, and free-form properties to be used as configuration
   |       variables for plugins in the POM.
   |
   |-->
  <profiles>
    <!-- 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 <activatedProfiles/>
     | 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.
    <profile>
      <id>jdk-1.4</id>

      <activation>
        <jdk>1.4</jdk>
      </activation>

      <repositories>
        <repository>
          <id>jdk14</id>
          <name>Repository for JDK 1.4 builds</name>
          <url>http://www.myhost.com/maven/jdk14</url>
          <layout>default</layout>
          <snapshotPolicy>always</snapshotPolicy>
        </repository>
      </repositories>
    </profile>
    -->

    <!--
     | 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:
     |
     | ...
     | <plugin>
     |   <groupId>org.myco.myplugins</groupId>
     |   <artifactId>myplugin</artifactId>
     |
     |   <configuration>
     |     <tomcatLocation>${tomcatPath}</tomcatLocation>
     |   </configuration>
     | </plugin>
     | ...
     |
     | NOTE: If you just wanted to inject this configuration whenever someone set 'target-env' to
     |       anything, you could just leave off the <value/> inside the activation-property.
     |
    <profile>
      <id>env-dev</id>

      <activation>
        <property>
          <name>target-env</name>
          <value>dev</value>
        </property>
      </activation>

      <properties>
        <tomcatPath>/path/to/tomcat/instance</tomcatPath>
      </properties>
    </profile>
    -->
  </profiles>

  <!-- activeProfiles
   | List of profiles that are active for all builds.
   |
  <activeProfiles>
    <activeProfile>alwaysActiveProfile</activeProfile>
    <activeProfile>anotherAlwaysActiveProfile</activeProfile>
  </activeProfiles>
  -->
</settings>

这里有些细节 可以自寻maven的配置

 第四步 安装Android Studio

首先访问

Download Android Studio & App Tools - Android Developers

这是Android Studio的国内官方下载地址

下载完成后

安装

android studio安装,软件安装,android studio,android,gradle

android studio安装,软件安装,android studio,android,gradle

android studio安装,软件安装,android studio,android,gradle

android studio安装,软件安装,android studio,android,gradle

 android studio安装,软件安装,android studio,android,gradle

 android studio安装,软件安装,android studio,android,gradle

 android studio安装,软件安装,android studio,android,gradle

 android studio安装,软件安装,android studio,android,gradle

这里是我的jdk的放置位置

 android studio安装,软件安装,android studio,android,gradle

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

 android studio安装,软件安装,android studio,android,gradle

android studio安装,软件安装,android studio,android,gradle

需要接受的都得接受

android studio安装,软件安装,android studio,android,gradle

android studio安装,软件安装,android studio,android,gradle

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

 android studio安装,软件安装,android studio,android,gradle

 android studio安装,软件安装,android studio,android,gradle

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

android studio安装,软件安装,android studio,android,gradle

android studio安装,软件安装,android studio,android,gradle

gradle开始下载 资源

 android studio安装,软件安装,android studio,android,gradle

 这里会出现下载中断报错的原因

这里就需要重新构建

也就是重新下载资源

这里你会发现使用的是阿里云的仓库下载资源

android studio安装,软件安装,android studio,android,gradle

所有资源下载完成

android studio安装,软件安装,android studio,android,gradle

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

android studio安装,软件安装,android studio,android,gradle

android studio安装,软件安装,android studio,android,gradle

 这里是运行成功的效果

android studio安装,软件安装,android studio,android,gradle文章来源地址https://www.toymoban.com/news/detail-755170.html

到了这里,关于Android Studio的安装详细步骤的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • Android Studio下载及安装和Gradle的配置(非常详细)从零基础入门到精通,看完这一篇就够了

    文章目录 下载 安装 修改Sdk的位置 创建项目 修改Gradle的位置 查看AS版本 工具栏–View项 工具栏–Build下的功能说明 Build Variants视图说明 下载模拟器(avd)/安卓虚拟设备 屏幕熄灭功能 关闭虚拟设备功能 删除自己开发的应用软件 将开发的应用运行到虚拟设备上。 修改模拟器

    2024年02月09日
    浏览(44)
  • Android Studio下载及安装和Gradle的配置(非常详细)从零基础入门到精通,看完这一篇就够了_

    文章目录 下载 安装 修改Sdk的位置 创建项目 修改Gradle的位置 查看AS版本 工具栏–View项 工具栏–Build下的功能说明 Build Variants视图说明 下载模拟器(avd)/安卓虚拟设备 屏幕熄灭功能 关闭虚拟设备功能 删除自己开发的应用软件 将开发的应用运行到虚拟设备上。 修改模拟器

    2024年02月06日
    浏览(42)
  • Android Studio Giraffe安装与gradle配置

    本机环境:win10专业版,64位,16G内存。 原先用的AS2.2,是很早之前在看《第一行代码Android(第2版)》的时候,按书里的链接下载安装的,也不用怎么配置。(PS:第一行代码这本书对新手确实很适合,第1版是eclise,第2版是Android studio) 最近想给AS升级一下,果不其然碰到很多

    2024年02月13日
    浏览(39)
  • Android Studio下载及安装和Gradle的配置

    下载地址:官方下载地址 打开后往下拉,直到最后的I agree to the terms. 这里选择的android studio版本是:2021.2.1.16,也可以根据自己的需要下载其他的版本。 至此下载的过程讲解完毕,由于官网的界面会不定时的变动。以后有变动了,再更新下载方式。 双击上面的exe文件 点击

    2024年02月06日
    浏览(31)
  • 初次安装Android Studio卡在gradle的解决方法

    国外的下载的地址无法访问才导致无法下载 找到新建项目的保存位置找到gradle文件夹 进入文件夹  用文本打开 如图 大概一样,将国外地址改为国内地址 选中的这一条 腾讯云提供了 Gradle 的国内镜像,您可以通过访问腾讯云的官方镜像站来查找 Gradle 8.2 的下载链接。通常,

    2024年02月22日
    浏览(39)
  • 可能会解决你Android studio中gradle安装的问题

    我的电脑让我不小心弄出了很多小毛病,我忍不了了,重装了系统 然后在我配置as时发现gradle竟然出现了好多问题,看了好多的帖子发现都对我没用!!! 概括 问题是下载gradle超时 检查是否有.gradle这个文件,有则改名,没有的话就先下载,看报不报错,报错了就看下一步(

    2024年02月03日
    浏览(34)
  • Android Studio gradle 8.0 版本安装出现 Read Timed Out

    原因:国外网站下载速度太慢 解决:配置aliyun镜像 首先打开build.gradle文件查看plugins中的id和version在以下链接搜索是否存在 https://developer.aliyun.com/mvn/search 如果不存在,那就降低gradle版本到存在的版本 然后在build.gradle文件中添加如下配置 在settting.gradle文件中修改为如下配置

    2024年02月05日
    浏览(37)
  • Android Studio 配置国内镜像源、HTTP代理(详细步骤)

    本文只介绍单个项目配置,所有项目配置自行百度。 新老版本 Android Studio 配置文件稍有不同。 pluginManagement 和 dependencyResolutionManagement 里面的 repositories 都需要填写。 不同版本的 gradle 文件的 url 格式不一样。 备用一套镜像地址,这套与下面的镜像地址不同,如果下面的案例

    2024年02月02日
    浏览(42)
  • 保姆式教程:MAC安装Android studio(包括安装JDK,Android SDK),解决gradle下载慢的问题

    原文链接 原文链接 下载地址 下载后双击安装包 打开Mac的终端,输入命令查询JDK的安装路径 配置环境之前需要清楚这个JDK的安装路径,如果知道就不用查 输入以上字符串,就会输出JDK的安装路径,将这个路径复制暂且复制下来,一会儿用。 然后接下来我们在终端输入相应的

    2024年02月04日
    浏览(46)
  • Android Gradle Plugin、Gradle、Android Studio版本关系

    参考链接 插件版本 所需的最低 Gradle 版本 8.3 8.4 8.2 8.2 8.1 8.0 8.0 8.0 7.4 7.5 7.3 7.4 7.2 7.3.3 7.1 7.2 7.0 7.0 4.2.0+ 6.7.1 4.1.0+ 6.5+ 4.0.0+ 6.1.1+ 3.6.0 - 3.6.4 5.6.4+ 3.5.0 - 3.5.4 5.4.1+ 3.4.0 - 3.4.3 5.1.1+ 3.3.0 - 3.3.3 4.10.1+ 3.2.0 - 3.2.1 4.6+ 3.1.0+ 4.4+ 3.0.0+ 4.1+ 2.3.0+ 3.3+ 2.1.3 - 2.2.3 2.14.1 - 3.5 2.0.0 - 2.1.2 2.10 - 2.1

    2024年02月20日
    浏览(42)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包