Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/225.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 我如何纠正警告;Drive.API已被弃用;?_Android_Google Drive Android Api - Fatal编程技术网

Android 我如何纠正警告;Drive.API已被弃用;?

Android 我如何纠正警告;Drive.API已被弃用;?,android,google-drive-android-api,Android,Google Drive Android Api,以下是我创建与Google Drive服务连接的GoogleAppClient实例的代码: mGoogleApiClient = new GoogleApiClient.Builder(this) .enableAutoManage(this /* FragmentActivity */, this /* OnConnectionFailedListener */) .addApi(Auth.GOOGLE_SIG

以下是我创建与Google Drive服务连接的GoogleAppClient实例的代码:

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();

我收到了警告

不推荐使用“API”


如何防止出现此警告?

此处给出了不推荐使用的Google Drive API的全局答案 与适当的文件链接


感谢@Arshad和@noogui

忽略警告使用此选项,您可以使用此选项修复警告,因为它已弃用。您需要使用这些驱动程序函数感谢@Arshad,整套API已弃用,让我们以新的方式再次使用
implementation 'com.google.android.gms:play-services-auth:15.0.0'
implementation 'com.google.android.gms:play-services-drive:15.0.0'