android studio 新建項(xiàng)目報(bào)錯(cuò)的解決之路
android studio 新建工程報(bào)錯(cuò)
Error:Could not resolve all files for configuration ':app:debugCompileClasspath'.
> Could not resolve com.android.support:appcompat-v7:26.0.0-beta1.
Required by:
project :app
> Could not resolve com.android.support:appcompat-v7:26.0.0-beta1.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/support/appcompat-v7/26.0.0-beta1/appcompat-v7-26.0.0-beta1.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/support/appcompat-v7/26.0.0-beta1/appcompat-v7-26.0.0-beta1.pom'.
> Connect to dl.google.com:443 [dl.google.com/203.208.46.146] failed: Operation timed out (Connection timed out)
1、取消代理
Preferences->Appearance & Behavior->System Settings->Http Proxy
選擇 No Proxy
2、取消隱藏代理
關(guān)掉隱形代理在mac 上對(duì)應(yīng)的目錄:~/.gradle/gradle.properties
3、
Preferences->Build,Execution,Deployment->Gradle,取消“offline work”的勾選,讓studio去下載即可。
4、
Preferences->Build,Execution,Deployment->Gradle->Android Studio
取消勾選Disable embedded Maven Repository
5、修改project的bulid.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
在兩個(gè)repository加了,阿里云的鏡像
maven {
url 'http://maven.aliyun.com/nexus/content/groups/public/'
}
再次sync,問題解決,但是把maven去掉,也能正常sync,有點(diǎn)迷,前幾步,我的as本來就配好沒有修改,猜測(cè)可能是wifi不好。。。
知識(shí)點(diǎn)補(bǔ)充:Android Studio 新建工程報(bào)錯(cuò)“”Error occurred during initialization of VM ..."解決辦法
Android Studio 新建工程報(bào)錯(cuò):
Error occurred during initialization of VM Could not reserve enough space for 1572864KB object heap
You encounter following error:
Error occurred during initialization of VM Could not reserve enough space for 1572864KB object heap
原因:Java虛擬機(jī)(JVM)沒有足夠的內(nèi)存空間。
解決方案:
1:在個(gè)人文件夾( (C:/Users/username/.gradle 或 ~/.gradle))下創(chuàng)建gradle.properties文件,添加
org.gradle.jvmargs=-Xmx512m -XX:MaxPermSize=512m
2:或者直接在Android Studio中g(shù)radle.properties文件中添加下面這行,存在則修改
org.gradle.jvmargs=-Xmx512m -XX:MaxPermSize=512m
總結(jié)
到此這篇關(guān)于android studio 新建項(xiàng)目報(bào)錯(cuò)解決之路的文章就介紹到這了,更多相關(guān)android studio 新建工程報(bào)錯(cuò)內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
Android編程實(shí)現(xiàn)變化的雙重選擇框功能示例
這篇文章主要介紹了Android編程實(shí)現(xiàn)變化的雙重選擇框功能,結(jié)合實(shí)例形式分析了Android雙重選擇框功能的樣式布局與功能實(shí)現(xiàn)技巧,需要的朋友可以參考下2017-10-10
android使用Messenger綁定Service的多種實(shí)現(xiàn)方法
android使用Messenger綁定Service的多種實(shí)現(xiàn)方法,需要的朋友可以參考一下2013-05-05
使用Win10+Android+夜神安卓模擬器,搭建ReactNative開發(fā)環(huán)境
今天小編就為大家分享一篇關(guān)于使用Win10+Android+夜神安卓模擬器,搭建ReactNative開發(fā)環(huán)境,小編覺得內(nèi)容挺不錯(cuò)的,現(xiàn)在分享給大家,具有很好的參考價(jià)值,需要的朋友一起跟隨小編來看看吧2018-10-10
Android應(yīng)用中加入微信分享簡(jiǎn)單方法
這篇文章主要介紹了Android應(yīng)用中加入微信分享簡(jiǎn)單方法,本文用簡(jiǎn)潔明快的步驟講解了加入微信分享的方法,需要的朋友可以參考下2015-05-05
Android Flutter實(shí)戰(zhàn)之為照片添加顏色濾鏡
這篇文章我們將利用TweenAnimationBuilder來實(shí)現(xiàn)一個(gè)圖片調(diào)色的過渡動(dòng)畫,從而實(shí)現(xiàn)為照片添加顏色濾鏡的效果,感興趣的可以了解一下2022-12-12
支付寶咻一咻怎么用 Android幫你實(shí)現(xiàn)咻一咻
Android幫你實(shí)現(xiàn)咻一咻,這篇文章主要為大家介紹了支付寶咻一咻的幾種思路,感興趣的朋友可以參考一下2016-02-02
Android序列化實(shí)現(xiàn)接口Serializable與Parcelable詳解
我們使用 Intent 傳遞數(shù)據(jù)的時(shí)候,putExtra() 所支持的數(shù)據(jù)類型事有限的,當(dāng)需要傳遞自定義對(duì)象的時(shí)候就需要序列化。Serializable更簡(jiǎn)單但是會(huì)把整個(gè)對(duì)象進(jìn)行序列化因此效率比Parcelable低一些2022-12-12
Android應(yīng)用中使用及實(shí)現(xiàn)系統(tǒng)“分享”接口實(shí)例
為了應(yīng)用的推廣、傳播,很多的應(yīng)用中都有“分享”功能,這篇文章主要介紹了Android應(yīng)用中使用及實(shí)現(xiàn)系統(tǒng)“分享”接口實(shí)例,有興趣的可以了解一下。2016-12-12

