繁体   English   中英

Android Studio的Gradle Sync(SDK)问题

[英]Gradle Sync (SDK) issue with Android Studio

apply plugin: 'com.android.application'

repositories {
mavenLocal()
flatDir {
    dirs 'libs'
}
}
android {
compileSdkVersion 24
buildToolsVersion '25.0.0'

defaultConfig {
    applicationId "com.google.firebase.udacity.friendlychat"
    minSdkVersion 16
    targetSdkVersion 24
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 
'proguard-rules.pro'
    }
}
packagingOptions {
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/LICENSE-FIREBASE.txt'
    exclude 'META-INF/NOTICE'
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'

compile 'com.android.support:design:24.2.0'
compile 'com.android.support:appcompat-v7:24.2.0'

//firebase

// Displaying images
compile 'com.github.bumptech.glide:glide:3.6.1'
compile 'com.google.firebase:firebase-database:10.2.0' // adding database 
dependency to SDK
}
apply plugin: 'com.google.gms.google-services'

这些是我收到的gradle同步错误。

错误:(37,13)无法解决:com.android.support:design:24.2.0

错误:(38,13)无法解决:com.android.support:appcompat-v7:24.2.0

有人可以告诉我什么需要更改才能运行。 一直到我更新Android Studio为止。

提前致谢

改变

buildToolsVersion '25.0.0'

buildToolsVersion '24.2.0'

希望对您有所帮助!

UPDATE

我知道了,截至3月,有一个新的存储库更新

所以我改变了

buildToolsVersion '24.0.1'

我将构建版本更改为

buildToolsVersion '25.0.2' //this is actually the latest as of 12/4/17

然后将依赖项从更改为该版本

compile 'com.android.support:design:24.2.0'
compile 'com.android.support:appcompat-v7:24.2.0'

compile 'com.android.support:design:25.3.1'
compile 'com.android.support:appcompat-v7:25.3.1' 

现在我没有错误,并且我的gradle实际上已经建立,我希望这对可能遇到它的人是有用的

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM