首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >尝试在ionic应用程序中执行构建时出现异常

尝试在ionic应用程序中执行构建时出现异常
EN

Stack Overflow用户
提问于 2016-05-09 22:57:52
回答 1查看 58关注 0票数 1

我在运行‘not build android’命令时遇到了问题,我无法解决。之前运行离子命令'platform android add‘。

代码语言:javascript
复制
D:\ionic\hello>ionic build android
Running command: "C:\Program Files (x86)\nodejs\node.exe" D:\ionic\hello\hooks\a
fter_prepare\010_add_platform_class.js D:\ionic\hello
add to body class: platform-android
ANDROID_HOME=C:\android-sdk-win
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_65

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.2.3.
     Required by:
         :android:unspecified
      > Could not GET 'https://repo1.maven.org/maven2/com/android/tools/build/gr
adle/1.2.3/gradle-1.2.3.pom'.
         > peer not authenticated

* 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: 1.585 secs
Error: Error code 1 for command: cmd with args: /s,/c,"D:\ionic\hello\platforms\
android\gradlew cdvBuildDebug -b D:\ionic\hello\platforms\android\build.gradle -
Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true"

我需要生成一个包来在android设备上执行测试。我的build.gradle是:

代码语言:javascript
复制
apply plugin: 'android'

buildscript {
    repositories {
        mavenCentral()
    }

    // Switch the Android Gradle plugin version requirement depending on the
    // installed version of Gradle. This dependency is documented at
    // http://tools.android.com/tech-docs/new-build-system/version-compatibility
    // and https://issues.apache.org/jira/browse/CB-8143
    dependencies {
        classpath 'com.android.tools.build:gradle:1.2.3'
    }
   }

// Allow plugins to declare Maven dependencies via build-extras.gradle.
repositories {
    mavenCentral()
}

task wrapper(type: Wrapper) {
    gradleVersion = '2.8'
}

..。

我该怎么解决呢?

EN

回答 1

Stack Overflow用户

发布于 2016-05-10 16:16:18

将旧的gradle-1.2.3-all.zip替换为新下载的https://services.gradle.org/distributions/gradle-2.2.1-all.zip并重试。

可能是C:\Users\shashi.gradle\wrapper\dists\gradle-2.2.1-all中的Gradle文件

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37119001

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档