【发布时间】:2018-04-08 15:20:25
【问题描述】:
错误:找不到方法 'com.android.build.gradle.api.BaseVariant.getOutputs()Ljava/util/List;'。 此意外错误的可能原因包括: Gradle 的依赖项 缓存可能已损坏(这有时会在网络连接后发生 超时。)
重新下载依赖并同步项目(需要网络)。
Gradle 构建过程(守护进程)的状态可能已损坏。停止 所有 Gradle 守护进程都可以解决这个问题。
停止
Gradle构建进程(需要重新启动)。您的项目可能是 使用与其他插件不兼容的第三方插件 项目中的插件或Gradle请求的版本 项目。在 Gradle 进程损坏的情况下,您也可以尝试关闭 IDE,然后杀死所有 Java 进程。
这是我的 build.gradle 文件
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.minh.findtheshipper"
minSdkVersion 21
targetSdkVersion 26
versionCode 1
versionName "1.0"
ext.kotlin_version = '1.1.2-4'
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
manifestPlaceholders = [onesignal_app_id: "c435c556-1f73-4ac6-9c50-11d2c08e803c",
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: "REMOTE"]
}
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion '26.0.2'
}
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile('com.mikepenz:materialdrawer:5.9.2@aar') {
transitive = true
}
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.jakewharton:butterknife:8.6.0'
compile 'com.mikepenz:google-material-typeface:3.0.1.0.original@aar'
compile 'com.mikepenz:fontawesome-typeface:4.7.0.0@aar'
compile 'com.facebook.android:facebook-android-sdk:4.27.0'
compile 'com.sdsmdg.tastytoast:tastytoast:0.1.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.github.bumptech.glide:glide:4.0.0'
compile 'com.google.android.gms:play-services-maps:11.4.2'
compile 'com.google.maps.android:android-maps-utils:0.5'
compile 'com.google.android.gms:play-services-location:11.4.2'
compile 'com.google.android.gms:play-services-places:11.4.2'
compile 'cn.pedant.sweetalert:library:1.3'
compile 'com.mikepenz:actionitembadge:3.3.1@aar'
compile 'com.android.support:cardview-v7:26.1.0'
compile 'com.android.support:support-v4:26.1.0'
compile 'com.google.firebase:firebase-core:11.4.2'
compile 'com.google.firebase:firebase-database:11.4.2'
compile 'com.google.firebase:firebase-messaging:11.4.2'
compile 'com.github.markushi:circlebutton:1.1'
compile 'com.onesignal:OneSignal:3.6.5'
compile 'com.kofigyan.stateprogressbar:stateprogressbar:0.0.6'
compile 'com.squareup.okhttp3:okhttp:3.9.0'
testCompile 'junit:junit:4.12'
annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0-RC1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.6.0'
}
apply plugin: 'com.jakewharton.butterknife'
apply plugin: 'realm-android'
apply plugin: 'com.google.gms.google-services'
【问题讨论】:
-
尝试无效缓存/重启。
-
@MiteshVanaliya。我做到了。但它仍然是“成绩同步问题”。
标签: android gradle android-gradle-plugin