2017-07-19 105 views
0

Gradle無法通過Nexus Repository解析依賴關係,因爲工件可通過瀏覽器下載。我有以下錯誤Gradle無法通過Nexus解析依賴關係,但在瀏覽器中下載了工件

Error:Could not find ecj.jar (org.eclipse.jdt.core.compiler:ecj:4.6.1). Searched in the following locations: http://infynexus/nexus/content/groups/Manoj.P04/org/eclipse/jdt/core/compiler/ecj/4.6.1/ecj-4.6.1.jar

,但這個罐子是可下載的瀏覽器 Chrome Screenshot

的build.gradle

buildscript { 
    repositories { 
     maven { 
      credentials { 
       username mavenUser 
       password mavenPassword 
      } 
      url 'http://infynexus/nexus/content/groups/Manoj.P04/' 
     } 

    } 


    dependencies { 
     classpath 'com.android.tools.build:gradle:2.3.3' 

     // NOTE: Do not place your application dependencies here; they belong 
     // in the individual module build.gradle files 
    } 
} 

allprojects { 
    repositories { 
     maven { 
      credentials { 
       username mavenUser 
       password mavenPassword 
      } 
      url 'infynexus/nexus/content/groups/Manoj.P04/' 
     } 

     task clean(type: Delete) { 
      delete rootProject.buildDir 
     } 
    } 
} 

gradle.properties

org.gradle.jvmargs=-Xmx1536m 

mavenUser=xxxx 
mavenPassword=xxx 
+0

嗨#Manoj,面對同樣的問題? –

+1

Android Studio緩存存在一些問題。我到了以下位置C:\ Users \ manoj.p04 \ AppData \ Local \ Android \ Sdk \ tools \ lib,並發現存在ecj-4.6.1.jar。我刪除了,並syched,一切正常現在 –

+0

oh.move在前面。添加你的答案 –

回答

0

您可以在應用程序級別下方添加的build.gradle部分

dependencies { 
    compile group: 'org.eclipse.jdt.core.compiler', name: 'ecj', version: '4.5.1' 
} 
0

有一些問題與Android工作室緩存。我去了以下位置:

C:\Users\manoj.p04\AppData\Local\Android\Sdk\tools\lib

和ecj-4.6.1.jar在場。我刪除了罐子和重新同步,現在一切工作正常..

感謝

相關問題