原来ionic platform add android时
只自动创建了gradle wrapper及配置(gradle-wrapper.properties)
首次构建时在根据其distributionUrl项指定的Gradle版本地址进行下载安装
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
[srj@x1c xhw-app]$ ionic build android Running command: /home/srj/Git/Free/xhw-app/hooks/after_prepare/010_add_platform_class.js /home/srj/Git/Free/xhw-app add to body class: platform-android Running command: /home/srj/Git/Free/xhw-app/platforms/android/cordova/build ANDROID_HOME=/opt/android-sdk JAVA_HOME=/opt/java/jdk1.8.0_60 Running: /home/srj/Git/Free/xhw-app/platforms/android/gradlew cdvBuildDebug -b /home/srj/Git/Free/xhw-app/platforms/android/build.gradle -Dorg.gradle.daemon=true Downloading http://services.gradle.org/distributions/gradle-2.2.1-all.zip ................................................................................................................................................... ............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... Unzipping /home/srj/.gradle/wrapper/dists/gradle-2.2.1-all/2m8005s69iu8v0oiejfej094b/gradle-2.2.1-all.zip to /home/srj/.gradle/wrapper/dists/gradle-2.2.1-all/2m8005s69iu8v0oiejfej094b Set executable permissions for: /home/srj/.gradle/wrapper/dists/gradle-2.2.1-all/2m8005s69iu8v0oiejfej094b/gradle-2.2.1/bin/gradle Download https://repo1.maven.org/maven2/com/android/tools/build/gradle/1.0.0/gradle-1.0.0.pom Download https://repo1.maven.org/maven2/com/android/tools/build/builder/1.0.0/builder-1.0.0.pom Download https://repo1.maven.org/maven2/com/android/tools/lint/lint/24.0.0/lint-24.0.0.pom Download https://repo1.maven.org/maven2/net/sf/proguard/proguard-gradle/5.1/proguard-gradle-5.1.pom Download https://repo1.maven.org/maven2/net/sf/proguard/proguard-parent/5.1/proguard-parent-5.1.pom Download https://repo1.maven.org/maven2/com/android/tools/sdk-common/24.0.0/sdk-common-24.0.0.pom Download https://repo1.maven.org/maven2/org/bouncycastle/bcprov-jdk15on/1.48/bcprov-jdk15on-1.48.pom Download https://repo1.maven.org/maven2/com/squareup/javawriter/2.5.0/javawriter-2.5.0.pom Download https://repo1.maven.org/maven2/org/sonatype/oss/oss-parent/7/oss-parent-7.pom Download https://repo1.maven.org/maven2/com/android/tools/common/24.0.0/common-24.0.0.pom Download https://repo1.maven.org/maven2/com/android/tools/build/builder-test-api/1.0.0/builder-test-api-1.0.0.pom Download https://repo1.maven.org/maven2/com/android/tools/ddms/ddmlib/24.0.0/ddmlib-24.0.0.pom Download https://repo1.maven.org/maven2/com/android/tools/build/manifest-merger/24.0.0/manifest-merger-24.0.0.pom Download https://repo1.maven.org/maven2/com/android/tools/build/builder-model/1.0.0/builder-model-1.0.0.pom Download https://repo1.maven.org/maven2/com/android/tools/sdklib/24.0.0/sdklib-24.0.0.pom Download https://repo1.maven.org/maven2/org/bouncycastle/bcpkix-jdk15on/1.48/bcpkix-jdk15on-1.48.pom Download https://repo1.maven.org/maven2/com/android/tools/lint/lint-checks/24.0.0/lint-checks-24.0.0.pom Download https://repo1.maven.org/maven2/org/eclipse/jdt/core/compiler/ecj/4.2.2/ecj-4.2.2.pom Download https://repo1.maven.org/maven2/net/sf/proguard/proguard-base/5.1/proguard-base-5.1.pom Download https://repo1.maven.org/maven2/com/google/guava/guava/17.0/guava-17.0.pom Download https://repo1.maven.org/maven2/com/google/guava/guava-parent/17.0/guava-parent-17.0.pom Download https://repo1.maven.org/maven2/net/sf/kxml/kxml2/2.3.0/kxml2-2.3.0.pom Download https://repo1.maven.org/maven2/com/android/tools/layoutlib/layoutlib-api/24.0.0/layoutlib-api-24.0.0.pom Download https://repo1.maven.org/maven2/org/apache/httpcomponents/httpclient/4.1.1/httpclient-4.1.1.pom Download https://repo1.maven.org/maven2/org/apache/httpcomponents/httpcomponents-client/4.1.1/httpcomponents-client-4.1.1.pom Download https://repo1.maven.org/maven2/org/apache/httpcomponents/project/4.1.1/project-4.1.1.pom Download https://repo1.maven.org/maven2/org/apache/httpcomponents/httpmime/4.1/httpmime-4.1.pom Download https://repo1.maven.org/maven2/org/apache/httpcomponents/httpcomponents-client/4.1/httpcomponents-client-4.1.pom Download https://repo1.maven.org/maven2/com/android/tools/dvlib/24.0.0/dvlib-24.0.0.pom Download https://repo1.maven.org/maven2/org/apache/commons/commons-compress/1.8.1/commons-compress-1.8.1.pom Download https://repo1.maven.org/maven2/org/apache/commons/commons-parent/33/commons-parent-33.pom Download https://repo1.maven.org/maven2/org/apache/apache/13/apache-13.pom Download https://repo1.maven.org/maven2/com/android/tools/lint/lint-api/24.0.0/lint-api-24.0.0.pom Download https://repo1.maven.org/maven2/org/ow2/asm/asm-analysis/4.0/asm-analysis-4.0.pom Download https://repo1.maven.org/maven2/org/ow2/asm/asm-parent/4.0/asm-parent-4.0.pom Download https://repo1.maven.org/maven2/org/ow2/ow2/1.3/ow2-1.3.pom Download https://repo1.maven.org/maven2/org/apache/httpcomponents/httpcore/4.1/httpcore-4.1.pom Download https://repo1.maven.org/maven2/org/apache/httpcomponents/httpcomponents-core/4.1/httpcomponents-core-4.1.pom Download https://repo1.maven.org/maven2/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.pom Download https://repo1.maven.org/maven2/org/apache/commons/commons-parent/5/commons-parent-5.pom Download https://repo1.maven.org/maven2/org/apache/apache/4/apache-4.pom Download https://repo1.maven.org/maven2/commons-codec/commons-codec/1.4/commons-codec-1.4.pom Download https://repo1.maven.org/maven2/org/apache/commons/commons-parent/11/commons-parent-11.pom Download https://repo1.maven.org/maven2/org/ow2/asm/asm/4.0/asm-4.0.pom Download https://repo1.maven.org/maven2/com/android/tools/external/lombok/lombok-ast/0.2.2/lombok-ast-0.2.2.pom Download https://repo1.maven.org/maven2/org/ow2/asm/asm-tree/4.0/asm-tree-4.0.pom Download https://repo1.maven.org/maven2/com/android/tools/build/gradle/1.0.0/gradle-1.0.0.jar Download https://repo1.maven.org/maven2/com/android/tools/build/builder/1.0.0/builder-1.0.0.jar Download https://repo1.maven.org/maven2/com/android/tools/lint/lint/24.0.0/lint-24.0.0.jar Download https://repo1.maven.org/maven2/net/sf/proguard/proguard-gradle/5.1/proguard-gradle-5.1.jar Download https://repo1.maven.org/maven2/com/android/tools/sdk-common/24.0.0/sdk-common-24.0.0.jar Download https://repo1.maven.org/maven2/org/bouncycastle/bcprov-jdk15on/1.48/bcprov-jdk15on-1.48.jar |
开始一切都很顺利,遇到什么下载什么
直到bcprov-jdk15on-1.48.jar时就卡死了,几个小时什么提示都没也不退出
wget重现一下发现刚开始下载很顺利,然后越来越慢,最后超时重试
不过由于默认会不断重试,最终还是成功下载回来的
以前还真没有遇到过一个仓库大部分可以顺利下载小部分艰难下载的情况
也许是刚好遇到网络不顺畅导致的假象?
还好开源中国提供了http://maven.oschina.net/content/groups/public/镜像
1 |
wget http://maven.oschina.net/content/groups/public/org/bouncycastle/bcprov-jdk15on/1.48/bcprov-jdk15on-1.48.jar |
测试一切良好
修改./platforms/android/build.gradle文件替换mavenCentral()为
maven { url “http://maven.oschina.net/content/groups/public/” }
后运行build可以顺利通过卡死点,不过不知道为什么,接下来的其它依赖总是下载推进几个就报Could not GET错误退出
1 2 3 4 5 6 7 8 9 10 11 12 13 |
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 download artifact 'httpcore.jar (org.apache.httpcomponents:httpcore:4.1)' > Could not GET 'http://maven.oschina.net/content/groups/public/org/apache/httpcomponents/httpcore/4.1/httpcore-4.1.jar'. > Premature end of Content-Length delimited message body (expected: 181041; received: 1136 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED |
要反复运行才可以抵达终点,难道是中国的镜像选择太少,大家一起用同一个服务器有些稳不住的缘故?