首页 > 解决方案 > 无法解析符号“服务”导入 com.google.api.services;

问题描述

我正在尝试为 google-api-java-client for android app遵循此示例,但在我的 Android 项目中,它没有解析符号servicesdrive。我下载了google-api-java-client的 lib 文件并将其复制到应用程序 lib 文件夹中。

包括以下应用程序 build.gradle

implementation 'com.google.android.gms:play-services-drive:15.0.1'
implementation 'com.google.android.gms:play-services-auth:15.0.1'
implementation "com.google.android.gms:play-services-gcm:15.0.1"
implementation 'com.google.android.gms:play-services-identity:15.0.1'
implementation 'com.google.apis:google-api-services-storage:v1-rev134-1.23.0'

并将以下内容添加到项目 build.gradle

buildscript {

    repositories {
        google()
        maven {url "https://maven.google.com"}
        jcenter()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
        classpath 'com.google.gms:google-services:3.2.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        maven {url "https://maven.google.com"}
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

但我仍然收到无法解析符号的错误。

标签: javaandroidgoogle-api-java-client

解决方案


推荐阅读