LoginSignup
5
4

More than 1 year has passed since last update.

[AndroidStudio]他の人のプロジェクトを開いた時にエラーが出たら

Last updated at Posted at 2022-03-25

概要

他の人から受け取ったプロジェクトをAndroidStudioで開こうとした時、以下のようなエラーが出る事があります。

SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file

スクリーンショット 2022-03-26 7.44.40.png

このエラーの解決方法を共有します。
(ファイルの内容を変更しますので、大切なファイルを扱う方はバックアップを取っておくといいかもしれません)

本文

プロジェクトフォルダの一番トップにlocal.propertiesファイルがあります(もし無かったら空ファイルを作成してファイル名をlocal.propertiesにして下さい)
このファイルを開くとプロジェクト作成者の環境用の設定が書かれているので、それを全て削除してファイルを保存します。

スクリーンショット 2022-03-26 7.56.44.png

AndroidStudio上でFile > Sync Project with Gradle Filesを選ぶとエラーが消えます!

スクリーンショット 2022-03-26 8.07.47.png

5
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
4