Android studio安装配置常见问题及其解决方案

更新时间:2023-06-08 17:10:01 阅读量: 实用文档 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

Android studio安装配置常见问题及其解决方案 Android studio 是目前android公司主推的一款开发工具,相比较以前eclipse,它自己内部就集成了SDK等,方便开发。这几天杰瑞教育学员也尝试从官网下载了一个android studio进行开发,但是在安装以及配置过程中遇到了几个问题,接下来与大家分享一下:

方法/步骤

1. 问题一

在安装的时候最好是按照它原来的路径安装,不要修改路径。我修改了路径后出现了一些问题,没有解决。

所以提醒大家,在安装的时候最好不要修改安装路径哦~

2. 问题二

'tools.jar' seems to be not in Android Studio classpath. Please ensure JAVA_HOME points to JDK rather than JRE.

在打开的过程中报出以上错误,tools包没有找到,解决方法是在设置环境变量中的JAVA HOME时需要注意,在最后需要以\结尾。如图:

3. 问题三

一直停留在fetching Android sdk compoment information界面

4. 出现该界面是一直在获得android sdk的信息。

解决方法:

1)找到安装的Android Studio目录下的bin目录。找到idea.properties文件,用文本编辑器打开。 2)在idea.properties文件末尾添加一行: disable.android.first.run=true ,然后保存文件。 3)关闭Android Studio后重新启动,便可进入界面。

5.

问题四 Failed to fetch URL /android/repository/repository.xml, reason: Connection timed out: connect

连接谷歌网络超时

解决方法:

打开SDK目录 安装时默认

。地址打为开C:\Users\Administrator\AppData\Local\Android\sdk

SDKManager,选择Tools下的Options,将如图所示选项勾上。也就是others中第一个选项

6. 6

然后打开C:\WINDOWS\system32\drivers\etc中的hosts文件,在最后一行添加如下内容:

203.208.46.146

74.125.113.121

203.208.46.146

203.208.46.146

我们在打开的过程中遇到了如上四个问题,解决之后就打开了android studio界面,如果大家还有其他问题,也欢迎大家和我们进行交流。

8:01:10 Gradle sync started

8:01:39 Gradle sync failed: Unable to start the daemon process.

This problem might be caused by incorrect configuration of the daemon.

For example, an unrecognized jvm option is used.

Please refer to the user guide chapter on the daemon at /docs/2.4/userguide/gradle_daemon.html

Please read the following process output to find out more:

-----------------------

Error occurred during initialization of VM

Could not reserve enough space for object heap

Error: Could not create the Java Virtual Machine.

Error: A fatal exception has occurred. Program will exit.

Consult IDE log for more details (Help | Show Log)

8:01:56 Gradle sync started

8:01:57 Gradle sync failed: Unable to start the daemon process.

This problem might be caused by incorrect configuration of the daemon.

For example, an unrecognized jvm option is used.

Please refer to the user guide chapter on the daemon at /docs/2.4/userguide/gradle_daemon.html

Please read the following process output to find out more:

-----------------------

Error occurred during initialization of VM

Could not reserve enough space for object heap

Error: Could not create the Java Virtual Machine.

Error: A fatal exception has occurred. Program will exit.

Consult IDE log for more details (Help | Show Log)

8:06:22 EmptyThrowable: Failed to fetch URL https:///android/repository/addons_list-2.xml, reason: connect timed out

8:10:00 EmptyThrowable: Failed to fetch URL https:///android/repository/addons_list-2.xml, reason: connect timed out

经google发现,原来android studio

是通过gradle对项目配置的,而系统中没有对android studio 的默认配置,就像Eclipse中的eclipse.ini文件。

解决方法:

在操作系统当前用户的.gradle文件夹下:C:\Users\Administrator\.gradle 设置

gradle.properties,若无就新增。

在文件中添加如下配置信息:

[plain] view plaincopy

1. org.gradle.jvmargs=-Xmx512m

本文来源:https://www.bwwdw.com/article/ghf1.html

Top