Sau khi cập nhật Android Studio từ Canary 3 đến Canary 4, lỗi sau được ném vào thời gian xây dựng.Android phụ thuộc có phiên bản khác nhau cho biên dịch và thời gian chạy
Android dependency 'com.android.support:support-support-v4' has different version for the compile (25.2.0) and runtime (26.0.0-beta2) classpath. You should manually set the same version via DependencyResolution.
Tôi đã chạy tìm kiếm hoàn chỉnh trong toàn bộ dự án và phiên bản 25.1.0
không được sử dụng.
App-build.gradle
android {
compileSdkVersion 26
buildToolsVersion '26.0.0'
defaultConfig {
applicationId "com.xxx.xxxx"
minSdkVersion 14
targetSdkVersion
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
debug {
debuggable true
}
release {
debuggable false
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
lintOptions {
abortOnError false
}
}}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
testImplementation 'junit:junit:4.12'
implementation project(':core')
implementation com.google.android.gms:play-services-gcm:9.0.0'
implementation('com.crashlytics.sdk.android:crashlytics:[email protected]') {
transitive = true
}
implementation 'com.android.support:multidex:1.0.1'
implementation 'com.flurry.android:analytics:7.0.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.6.0'
implementation 'com.jakewharton:butterknife:8.6.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
}
Thư viện-build.gradle:
apply plugin: 'com.android.library'
android {
compileSdkVersion 26
buildToolsVersion '26.0.0'
defaultConfig {
minSdkVersion 14
targetSdkVersion
versionCode 1
versionName "1.0"
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation files('libs/model.jar')
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:percent:26.0.0-beta2'
implementation 'com.android.support:appcompat-v7:26.0.0-beta2'
implementation 'com.android.support:support-core-utils:26.0.0-beta2'
implementation 'com.squareup.retrofit2:retrofit:2.0.2'
implementation 'com.squareup.picasso:picasso:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.0.2'
implementation 'com.squareup.okhttp3:logging-interceptor:3.2.0'
implementation 'uk.co.chrisjenx:calligraphy:2.2.0'
implementation 'com.google.code.gson:gson:2.2.4'
implementation 'com.android.support:design:26.0.0-beta2'
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.1'
}
Lưu ý: Dự án được xây dựng tốt trong Canary 3
Hi, tôi chạy lệnh phụ thuộc gradle và tôi gửi bài url ảnh chụp màn hình ở đây, imgur.com/dL35BaN. Tôi không bao giờ sử dụng Firebase trong dự án của mình. Thêm vào dòng đó trong gcm, nó không hoạt động mặc dù – DroidLearner
@DroidLearner Tôi có thể thiếu một cái gì đó, nhưng tôi không thấy bất kỳ tham chiếu đến com.android.support:support-compat trong ảnh chụp màn hình bạn đã đăng. Ngoài ra còn có một cảnh báo trong ảnh chụp màn hình đó đề cập đến cấu hình 'biên dịch' mà tôi không thấy trong tệp gradle của bạn trong OP. nó có khả năng là nó đến từ: submodule lõi. Bạn có thể đăng thông tin về gradle liên quan từ đó không? – jdonmoyer
Xin chào, hãy đăng cho bạn toàn bộ tệp gradle có cây phụ thuộc tại đây .. tệp gradle ứng dụng -> https://gist.github.com/anonymous/93affc0d75eb96b59f9fde51332b9716 tệp gradle lõi -> https://gist.github.com/ anonymous/5c85031f26ff766109061ab1f00b833d cây phụ thuộc -> https://gist.github.com/anonymous/71dd33b6fa4dc63dd357889e8aff01ee Hy vọng điều này sẽ hữu ích. – DroidLearner