升级到 Gradle 2.3.0 后 Android 应用导入错误

Import errors on Android app after upgrading to Gradle 2.3.0

我在 Android Studio 上有一个 Android 应用程序项目,其中包括以下两个导入语句:

import com.google.api.client.extensions.android.http.AndroidHttp;
import com.google.api.client.extensions.android.json.AndroidJsonFactory;

使用 Gradle 插件版本 2.2.3 时,这些导入没有问题。但是,升级到 Gradle 插件 2.3.1 后,语句显示错误: 'extensions' 在两种情况下都变为红色,并且错误显示 'cannot resolve extensions'.

这里有一些相关的背景信息:

Android Studio 版本 2.3.1

Gradle 版本 3.3

编译SDK版本25

buildToolsVersion '25.0.0'

Android SDK 工具版本 26.0.1

我已将其作为错误报告给 Google,但想知道是否还有其他人遇到过类似问题,或者可以想出可能的解释?

    dependencies {
        compile fileTree(include: ['*.jar'], dir: 'libs')
        compile project(path: ':backend', configuration: 'android-endpoints')
        compile 'com.android.support:appcompat-v7:25.2.0'
        compile 'com.android.support:support-v4:25.2.0'
        compile 'com.android.support:recyclerview-v7:25.2.0'
        compile 'com.android.support:design:25.2.0'
        compile 'com.android.support:percent:25.2.0'
        compile 'com.google.firebase:firebase-database:10.2.0'
        compile 'com.google.firebase:firebase-core:10.2.0'
        compile 'com.google.firebase:firebase-messaging:10.2.0'
        compile 'com.firebaseui:firebase-ui-database:1.0.1'
        compile 'com.fasterxml.jackson.core:jackson-annotations:2.8.0.rc2'
        compile 'com.google.code.findbugs:jsr305:2.0.1'
        compile 'com.android.support.constraint:constraint-layout:1.0.2'
        testCompile 'junit:junit:4.12'
}

我在您的 gradle 文件中看不到必要的依赖项。将其添加到您的依赖项中。

compile("com.google.api-client:google-api-client-android:1.22.0") {
    exclude group: 'com.google.code.findbugs'
}