Search code examples
androidgoogle-drive-android-api

How can I correct the warning "Drive.API is deprecated"?


Here is my code that creates a GoogleApiClient instance that connects with the Google Drive service:

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

with

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

I got the warning

'API' is deprecated

How can I prevent this warning ?


Solution

  • Global answer of Google Drive API deprecated was given there https://stackoverflow.com/a/47843323/9581467 with appropriate links for documentation

    Thanks @Arshad and @noogui