[英]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.