Search code examples
androidgoogle-drive-apigoogle-drive-android-api

Error com.google.android.gms.drive.DriveApi.DriveContentsResult cannot be resolved


I am working on Android Google Drive. As of now I am using the github sample code Android Demos. I am getting an error of

The import com.google.android.gms.drive.DriveApi.DriveContentsResult cannot be resolved

and

The import com.google.android.gms.drive.DriveContents cannot be resolved

I am using the updated Google play service and I have imported it properly.

I am using eclipse


Solution

  • The import com.google.android.gms.drive.DriveApi.DriveContentsResult cannot be resolved
    

    and

    The import com.google.android.gms.drive.DriveContents cannot be resolved
    

    This occur when we use old Google play service library and new code. Just delete the old library, download new Google play service library if you don't have and import the library to your workspace.

    When you do like this, if you are using

    import com.google.android.gms.drive.events.DriveEvent.Listener
    

    Then change the line to

    import com.google.android.gms.drive.events.ChangeListener;
    

    Because Listener became ChangeListener in the new lib, and make corresponding changes in the code.