Google Drive Android API から移行する
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Drive Android API は 2018 年 12 月 6 日をもって非推奨となり、2023 年 2 月 1 日に完全に提供が終了します。
タイムライン
日付 |
Drive Android API のステータス |
2018 年 12 月 6 日 |
非推奨は一般に告知されます。既存のクライアントは通常どおり API にアクセスできますが、すぐに移行作業を開始する必要があります。新しいクライアントは API を使用できません。 |
2019 年 10 月 21 日 |
Google Play 開発者サービス SDK の配布から Drive Android API が削除されました。アプリは、Drive Android API の依存関係を削除するまでビルドできませんが、既存のビルドは影響を受けません。Drive Android API の一般公開ドキュメントは利用できなくなります。 |
2022 年 3 月 3 日 |
Drive Android API は非推奨となり、すべての API 呼び出しは動作しません。クライアントはこの日までに移行する必要があります。 |
2023 年 2 月 1 日 |
Drive Android API は完全に停止され、すべての接続試行は失敗します。 |
Drive REST API を使用する
Drive REST API は、Drive Android API と同じ機能を提供します。たとえば、次の操作を行うことができます。
クライアントの移行作業を容易にするため、上記の各代替案を示すサンプルアプリが提供されています。また、REST API を使用してユーザーのドライブ ファイルを作成、変更、クエリする方法も示します。問題が発生した場合は、StackOverflow の google-drive-api タグをご覧ください。
移行
Drive Android API は非推奨となり、すべての API 呼び出しが機能しなくなったため、アプリが API を呼び出していないことを確認してください。これを行うには、API を初期化するコード addApi(Drive.API)
を削除します。
Drive Android API から移行せずに、アプリが API を呼び出そうとすると、次のエラー メッセージが返されます。
com.google.android.gms.common.api.ApiException: 17: API: Drive.API is not
available on this device. Connection failed with:
ConnectionResult{statusCode=API_UNAVAILABLE, resolution=null, message=null}
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-04 UTC。
[null,null,["最終更新日 2025-08-04 UTC。"],[],[],null,["# Migrate from the Google Drive Android API\n\n**The Drive Android API is deprecated as of December 6, 2018 and will be fully\nturned down on February 1, 2023**.\n\nTimeline\n--------\n\n| Date | Drive Android API status |\n|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| December 6, 2018 | Deprecation is [publicly announced](https://cloud.google.com/blog/products/application-development/sync-google-drive-files-to-apps-using-the-drive-rest-api-bidding-farewell-to-the-drive-android-api). Existing clients will be able to access the API normally, but should immediately commence with migration efforts. New clients must not use the API. |\n| October 21, 2019 | The Drive Android API is removed from the Google Play Services SDK distribution. Apps will be unable to build until removing the Drive Android API dependency, but existing builds will be unaffected. The Drive Android API public documentation will no longer be available. |\n| March 3, 2022 | The Drive Android API is deprecated and all API calls are non-operational. Clients must migrate by this date. |\n| February 1, 2023 | The Drive Android API will be fully turned down and all connection attempts will be unsuccessful. |\n\nUse the Drive REST API\n----------------------\n\nThe Drive REST API offers the same functionality as the Drive Android API,\nincluding ways to:\n\n- Share and collaborate as you expect from Drive. You can [manage permissions or prompt the Share dialog](/workspace/drive/api/guides/manage-sharing) to users as needed. The REST API also allows for commenting on files, allowing your app to interact with the conversation around a file.\n- Search for files using [`files.list`](/workspace/drive/api/v3/reference/files/list), based on traditional indexing or [your own customized, indexable text](/workspace/drive/api/guides/file).\n- Detect changes to files through the [Changes collection](/workspace/drive/api/v3/reference/changes) and to any shared with the user through [shared drives](/workspace/drive/api/guides/enable-shareddrives).\n- Export and convert Google Docs so that your app can easily [open a user's document](/workspace/drive/api/guides/integrate-open#specific).\n\nTo ease client migration efforts, a\n[sample app](https://github.com/googleworkspace/android-samples/tree/master/drive/deprecation) is provided which\ndemonstrates each of the proposed replacements above. It also shows how to\ncreate, modify, and query for a user's Drive files using the REST API. If you\nhave any issues, check out the\n[google-drive-api](https://stackoverflow.com/questions/tagged/google-drive-api?tab=Newest)\ntag on StackOverflow.\n\nMigration\n---------\n\nSince the Drive Android API is deprecated, and all API calls are\nnon-operational, make sure your app is no longer calling the API. To do this,\nremove the code that initializes the API: `addApi(Drive.API)`.\n\nIf you don't migrate from the Drive Android API, and your app attempts to call\nthe API, the following error message is returned:\n\n`com.google.android.gms.common.api.ApiException: 17: API: Drive.API is not\navailable on this device. Connection failed with:\nConnectionResult{statusCode=API_UNAVAILABLE, resolution=null, message=null}`"]]