ionic build android時(shí)gradle錯(cuò)誤

BUILD FAILED

Total time: 27.317 secs
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':classpath'.
   > Could not resolve com.android.tools.build:gradle:1.5.0.
     Required by:
         :android:unspecified
      > Could not GET 'https://repo1.maven.org/maven2/com/android/tools/build/gradle/1.5.0/gradle-1.5.0.pom'.
         > Connection to https://repo1.maven.org refused

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Error: Error code 1 for command: cmd with args: /s,/c,"D:\gitrepo\private\bitbucket\mfewordcard2\platforms\android\gradlew cdvBuil
dDebug -b D:\gitrepo\private\bitbucket\mfewordcard2\platforms\android\build.gradle -Dorg.gradle.daemon=true -Pandroid.useDeprecate
dNdk=true"
 

可以通過(guò)如下解決:

ionic platform add android 之后,在ionic build android 之前,請(qǐng)手工修改 <Project-dir>\platforms\android目錄 和 <Project-dir>\platforms\android\CordovaLib 目錄下的 build.gradle文件,

mavenCentral()
改成
jcenter {url "http://jcenter.bintray.com/"}

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

推薦閱讀更多精彩內(nèi)容