我从命令行100%使用phonegap。如果我在连接到互联网的情况下进行构建,它可以正常工作
$ phonegap build android
[phonegap] executing 'cordova build android'...
[phonegap] completed 'cordova build android'但是如果我断开与互联网的连接,我就会收到错误消息
$ phonegap build android
[phonegap] executing 'cordova build android'...
cp: no such file or directory: /Users/gregg/src/hft-mobile-app/icon.png
Running command: /Users/gregg/src/hft-mobile-app/platforms/android/cordova/build
ANDROID_HOME=/Users/gregg/Downloads/android-sdk-macosx
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home
Running: /Users/gregg/src/hft-mobile-app/platforms/android/gradlew cdvBuildDebug -b /Users/gregg/src/hft-mobile-app/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:
: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'.
>
repo1.maven.org: nodename nor servname provided, or not known
* Try:
Run with
--stacktrace option to get the stack trace. Run with
--info
or --debug
option to get more log output.
BUILD FAILED
Total time: 30.753 secs
/Users/gregg/src/hft-mobile-app/platforms/android/cordova/node_modules/q/q.js:126
throw e;
^
Error code 1 for command: /Users/gregg/src/hft-mobile-app/platforms/android/gradlew with args: cdvBuildDebug,-b,/Users/gregg/src/hft-mobile-app/platforms/android/build.gradle,-Dorg.gradle.daemon=true
ERROR building one of the platforms: Error: /Users/gregg/src/hft-mobile-app/platforms/android/cordova/build: Command failed with exit code 1
You may not have the required environment or OS to build this project
Error: /Users/gregg/src/hft-mobile-app/platforms/android/cordova/build: Command failed with exit code 1
at ChildProcess.whenDone (/usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1015:16)
at Process.ChildProcess._handle.onexit (child_process.js:1087:5)为什么命令行版本会呼叫总部?我如何让它100%离线构建?
注意:在尝试脱机构建时,我将此错误视为第二行
cp: no such file or directory: /Users/gregg/src/hft-mobile-app/icon.png但正如您所看到的,错误不会在网上发生。再加上所谓的that issue was was fixed according to this
我在OSX上,我已经安装了Android SDK。我不知道它是在打电话回家。如何让它离线构建?
发布于 2016-02-17 16:22:45
这就是我到目前为止所经历的。Ionic使用gradle进行android构建。它是第一次从互联网上下载所有依赖项。所以互联网对于第一个gradle版本来说是最重要的,但是它缓存了它们,并且不需要互联网来进一步的build.Since,你为什么不在全球范围内更新你的cordova和ionic。
npm install -g cordova ionichttps://stackoverflow.com/questions/30162498
复制相似问题