Error message:
FAILURE: Build failed with an exception.
What went wrong: A problem occurred configuring root project 'android'.
A problem occurred configuring project ':CordovaLib'. Could not resolve all dependencies for configuration ':CordovaLib:classpath'. Could not find 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:
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 . 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. 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
\\platforms\\android\\CordovaLib\\build.gradle and add in jcenter()
repositories {
mavenCentral()
jcenter()
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.