环境
Android studio 3.0
导入开源中国:
...
dependencies {
//noinspection GradleDependency
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.3.0'
}
ext {
compileSdkVersion = 25
buildToolsVersion = "25.*.*"
applicationId = "net.oschina.app"
minSdkVersion = 19
targetSdkVersion = 25
versionCode = 417
versionName = "v4.1.7 (1806190800)"
supportVersion = '25.*.*'
}
错误
Gradle sync failed: Cause: org.gradle.logging.StyledTextOutput$Style Consult IDE log for more details (Help | Show Log) (1m 35s 824ms)
原因
gradle , SDK,android studio 三者版本不一致,
android studio buildToolsVersion 最低为26.0.2
解决
调试版本就好了,如:
dependencies {
//noinspection GradleDependency
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.6.0'
}
ext {
compileSdkVersion = 26
buildToolsVersion = "26.0.2"
applicationId = "net.oschina.app"
minSdkVersion = 19
targetSdkVersion = 26
versionCode = 417
versionName = "v4.1.7 (1806190800)"
supportVersion = '26.0.2'
}
注意检查gradle:
distributionUrl=https://services.gradle.org/distributions/gradle-4.1-all.zip