[英]Ionic project won't build (or run) after android plugin updated to 2.2.0
Error message: 错误信息:
FAILURE: Build failed with an exception. 失败:构建失败,发生异常。
What went wrong: A problem occurred configuring root project 'android'. 出了什么问题:配置根项目“ android”时出现问题。
A problem occurred configuring project ':CordovaLib'.
配置项目':CordovaLib'时发生问题。 Could not resolve all dependencies for configuration ':CordovaLib:classpath'.
无法解析配置':CordovaLib:classpath'的所有依赖项。 Could not find com.android.tools.build:gradle:2.2.0.
找不到com.android.tools.build:gradle:2.2.0。 Searched in the following locations: https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.0/gradle-2.2.0.pom https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.0/gradle-2.2.0.jar Required by:
在以下位置搜索: https : //repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.0/gradle-2.2.0.pom https://repo1.maven.org/maven2 /com/android/tools/build/gradle/2.2.0/gradle-2.2.0.jar所需的:
android:CordovaLib:unspecified
删除platform / android文件夹,然后再次添加Android:
ionic platform add android
buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'
}
}
try modifying these in your build.gradle . 尝试在build.gradle中修改它们。 good luck
祝好运
buildscript {
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'
}
} }
add jcenter() to your repositories. 将jcenter()添加到您的存储库。 this worked for me.
这对我有用。
A bit late but as the other answers didn't work hopefully this will help others 有点晚了,但由于其他答案无法奏效,这会帮助其他人
cordova platform update android@6.1.0
cordova platform update android@6.1.0
\\platforms\\android\\CordovaLib\\build.gradle and add in jcenter() \\ platforms \\ android \\ CordovaLib \\ build.gradle并添加jcenter()
repositories {
mavenCentral()
jcenter()
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.