如何更正警告“Drive.API已弃用”?

时间:2018-04-27 10:31:46

标签: android google-drive-android-api

以下是我的代码,用于创建与Google云端硬盘服务相关联的GoogleApiClient实例:

mGoogleApiClient = new GoogleApiClient.Builder(this)
            .enableAutoManage(this /* FragmentActivity */, this /* 
                OnConnectionFailedListener */)

            .addApi(Auth.GOOGLE_SIGN_IN_API, gso)
            .addApi(Drive.API)
            .addScope(Drive.SCOPE_FILE)

            .build();

implementation 'com.google.android.gms:play-services-auth:15.0.0'
implementation 'com.google.android.gms:play-services-drive:15.0.0'

我收到了警告

'API'已弃用

如何阻止此警告?

1 个答案:

答案 0 :(得分:0)

已弃用Google Drive API的全局答案https://stackoverflow.com/a/47843323/9581467 有适当的文档链接

感谢@Arshad和@noogui