2017-10-07 220 views
0

我安裝了Android Studio並創建了一個項目。這就是我所做的一切,創建一個項目並給它命名。安裝時出現gradle build錯誤

,但我得到了以下錯誤消息:

C:\apps\sound\app\build.gradle 
    Error:Error:line (28)Failed to resolve: junit:junit:4.12 
<a href="openFile:C:/apps/sound/app/build.gradle">Show in File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a> 
    Error:Error:Failed to resolve: javax.inject:javax.inject:1 
<a href="openFile:C:/apps/sound/app/build.gradle">Open File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a> 
    Error:Error:Failed to resolve: javax.annotation:javax.annotation-api:1.2 
<a href="openFile:C:/apps/sound/app/build.gradle">Open File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a> 
    Error:Error:Failed to resolve: com.google.code.findbugs:jsr305:2.0.1 
<a href="openFile:C:/apps/sound/app/build.gradle">Open File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a> 
    Error:Error:Failed to resolve: org.hamcrest:hamcrest-library:1.3 
<a href="openFile:C:/apps/sound/app/build.gradle">Open File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a> 
    Error:Error:Failed to resolve: org.hamcrest:hamcrest-integration:1.3 
<a href="openFile:C:/apps/sound/app/build.gradle">Open File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a> 
    Error:Error:Failed to resolve: com.squareup:javawriter:2.1.1 
<a href="openFile:C:/apps/sound/app/build.gradle">Open File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a> 

通過這裏發表類似的問題來看,我試圖卸載並重新安裝和運行工作室作爲管理員,但我得到了相同的結果。我也關閉了防火牆。

卡住了第一個障礙!

意見建議

+0

你應該在論壇上尋找問題的原因,這裏是[https://stackoverflow.com/questions/32519219/error23-17-failed-to-resolve-junitjunit4-12](https://stackoverflow。 com/questions/32519219/error23-17-failed-to-resolve-junitjunit4-12) – Ismail

+0

我已經看過帽子線程並嘗試了一些建議。沒有人爲我工作 - 使用「url」http://repo1.maven.org/maven2「」作爲maven,使用jcenter的url - 「url」http://jcenter.bintray.com/「」..我可以在lib文件夾中看到junit jar。 – pir8ped

回答

0

問題解決了。我卸載了AS,卸載了Java並刪除了註冊表中對java的引用。安裝了AS,一切都很好。所以如果你和我一樣有問題,並且以前安裝過Java,這可能是你的問題的根源。