1
我有一個Ionic/Cordova項目,爲Android構建是用Gradle完成的。如何使用Gradle構建的Android Cordova項目離線構建?
我安裝了所有必要的Android SDK和項目建設精細多月,但今天它失敗,出現以下錯誤:
Running: d:\git\myproject\platforms\android\gradlew cdvBuildDebug -b d:\git\myproject\platforms\android\build.gradle -Dorg.gradle.daemon=true
FAILURE: Build failed with an exception.
* 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.0.0+.
Required by:
BUILD FAILED
Total time: 26.792 secs
:android:unspecified
> Failed to list versions for com.android.tools.build:gradle.
> Unable to load Maven meta-data from https://repo1.maven.org/maven2/com/android/tools/build/gradle/maven-metadata.xml.
> Could not GET 'https://repo1.maven.org/maven2/com/android/tools/build/gradle/maven-metadata.xml'.
> 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.
d:\git\myproject\platforms\android\cordova\node_modules\q\q.js:126
throw e;
^
Error code 1 for command: cmd with args: /s /c "d:\git\myproject\platforms\android\gradlew cdvBuildDebug -b d:\git\myproject\platforms\android\build.gradle -Dorg.gradle.daemon=true"
Error: cmd: Command failed with exit code 1
Cordova command failed with error code 1, aborting!
顯然,由於該項目是建築就好了幾個月,一切需要讓它構建已經在磁盤上,但構建可能會檢查Maven回購中是否有更新的工件版本,並且這是失敗的。
有時這不是一個非常期望的行爲。
是否可以將構建配置爲始終離線構建?