LoginSignup
46
42

More than 5 years have passed since last update.

Android Studio でプロジェクト名・パッケージ名を変更する

Posted at

Androidプロジェクト名、パッケージ名を含み全て名前を変更したい。
Android Studioで簡単に変更出来るだろうと容易な気持ちでしたが何気に手順が必要だったのでメモ

①パッケージ名を変更

AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="jp.co.hoge">

②build.gradleを編集する

build.gradle
android {
    defaultConfig {
        applicationId "jp.co.hoge"
    }
}

③Gradle Syncを行う

④パッケージ名とソースディレクトリのリファクタ

「Project」をAndroidビューにし、パッケージ名を右クリック
・【Refactor】→【Rename】(Rename package)
・【Refactor】→【Rename】(Rename directory)

⑤AndroidStudioを閉じる

⑥各種命名を変更する

・プロジェクトディレクトリの名前変更
・プロジェクト直下の"xxx.iml"を"hoge.iml"に変更

以上

参考

http://qiita.com/nusa/items/413c8a131ebc451e80f8
http://qiita.com/le_skamba/items/f838fe51a3396c26a262

46
42
2

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
46
42