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,問(wèn)題解決,但是把maven去掉,也能正常sync,有點(diǎn)迷,前幾步,我的as本來(lái)就配好沒(méi)有修改,猜測(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)沒(méi)有足夠的內(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)搜索好吧啦網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持好吧啦網(wǎng)!
相關(guān)文章:
1. Android打包篇:Android Studio將代碼打包成jar包教程2. Python使用urlretrieve實(shí)現(xiàn)直接遠(yuǎn)程下載圖片的示例代碼3. SpringBoot+TestNG單元測(cè)試的實(shí)現(xiàn)4. Springboot 全局日期格式化處理的實(shí)現(xiàn)5. vue實(shí)現(xiàn)web在線聊天功能6. 解決Android Studio 格式化 Format代碼快捷鍵問(wèn)題7. 完美解決vue 中多個(gè)echarts圖表自適應(yīng)的問(wèn)題8. JavaScript實(shí)現(xiàn)頁(yè)面動(dòng)態(tài)驗(yàn)證碼的實(shí)現(xiàn)示例9. Java使用Tesseract-Ocr識(shí)別數(shù)字10. JavaEE SpringMyBatis是什么? 它和Hibernate的區(qū)別及如何配置MyBatis
