Corodva Could not resolve com.android.tools.build:gradle:3.0.0 解決方法

Corodva Could not resolve com.android.tools.build:gradle:3.0.0 解決方法

使用 cordova run android 運行時,出現錯誤

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all files for configuration ':classpath'.
   > Could not resolve com.android.tools.build:gradle:3.0.0.
     Required by:
         project :
      > Could not resolve com.android.tools.build:gradle:3.0.0.
         > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom'.
            > Could not HEAD 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom'.
               > dl.google.com

搜索了很久,大部門的解決方案都是在repositories中加入google(),實際並沒有用。
後來想到可能是網絡問題,於是將 android/build.gradle android/app/build.gradle android/CordovaLib/build.gradle中 的所有 repositories改爲

repositories {
    jcenter()
       maven {
           url "http://maven.aliyun.com/nexus/content/groups/public/"
    }
}

然後就可以了。。。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章