1. 程式人生 > >android stdio環境安裝

android stdio環境安裝

2. android下載版本為如下

64位系統為:android-studio-ide-173.4907809-windows.exe

3. 待工具安裝好之後新建工程報下錯誤:

Could not GET xxx, Received status code 400 from server: Bad Request

4. 第3步又出現了新的問題

Unable to resolve dependency for ':[email protected]/compileClasspath': Could not resolve com.android.support:appcompat-v7:28.0.0.
Open File
Show Details
Could not GET “XXXXX.xml”Received status code 400

具體解決方式是找到這個檔案 C:\Users\nxbb\.gradle\gradle.properties 遮蔽掉裡面的代理資訊

## For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
#
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx1024m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
#
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
#Sat Oct 20 21:05:52 CST 2018
//------------以下部分遮蔽掉
#systemProp.https.proxyPort=80
#systemProp.http.proxyHost=mirrors.neusoft.edu.cn
#systemProp.https.proxyHost=mirrors.neusoft.edu.cn
#systemProp.http.proxyPort=80

5. 2018-10-16 Android stdion用不了,開啟工程無法編譯通過,發現gradle4.4變更成4.6,同時代理第4.中的代理路徑也變了,原來是遮蔽掉的,後面可能是gradle4.6的更新導致。現在是可以編譯了,具體我也搞不清修改了哪些地方,大概如下

5.1 先在build.gradle裡確定gradle外掛版本(注意是gradle外掛!!!),我的升級成了gradle4.6,其對應的外掛為

classpath 'com.android.tools.build:gradle:3.2.1'

5.2 File->setting->Build,Execution,Deloyment->Gradle,勾選"Use local gradle distribution",選擇gradle的路徑,記住這個匯入的路徑是Android stdio的安裝路徑,我的路徑如下

D:/Android Studio/gradle/gradle-4.6

5.3 File->setting->Build,Execution,Deloyment->Gradle->Android Stdio,勾選"Enable embeded Maven repostory"

5.4 可以用Every thing工具搜尋gradle.properties, 注意這個gradle.properties是在C盤目錄, 不是專案的目錄,將代理資訊遮蔽掉C:\Users\nxbb\.gradle\gradle.properties,按照上面第4.步驟處理即可

5.5 檢視該路徑下是否又gradle4.6版本,沒有就手動下載,然後解壓

C:\Users\nxbb\.gradle\wrapper\dists\gradle-4.6-all\bcst21l2brirad8k2ben1letg\gradle-4.6