java.lang.NoClassDefFoundError: com.google.api.services.drive.Drive

前端 未结 1 1711
醉话见心
醉话见心 2021-01-27 16:00

While trying to use any Drive class function:

Drive service = new Drive.Builder(AndroidHttp.newCompatibleTransport(),new GsonFactory(), credential).build();


        
相关标签:
1条回答
  • 2021-01-27 16:31

    I believe you have not included google-api-client-1.18.0-rc.jar library, that is the reason you are getting the exception.

    Once you download and unzip the Drive API library, please read the drive/readme.html. It has listed the dependent jars for google-api-services-drive-v2-rev123-1.18.0-rc.jar that need to be included. The dependent jars can be located in drive/libs folder.

    Following are the complete set of jars that need to be included for Android application:

    • google-api-services-drive-v2-rev123-1.18.0-rc.jar
    • google-api-client-1.18.0-rc.jar
    • google-oauth-client-1.18.0-rc.jar
    • google-http-client-1.18.0-rc.jar
    • jsr305-1.3.9.jar
    • google-http-client-gson-1.18.0-rc.jar
    • google-api-client-android-1.18.0-rc.jar
    • google-http-client-android-1.18.0-rc.jar
    0 讨论(0)
提交回复
热议问题