3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

EclipseとAndroid StudioでAndroid SDKを共有する

3
Last updated at Posted at 2015-01-04

2015/1/5 追記:
こんな面倒なことしなくても、custom installを選んでAndroid SDKの場所を指定すれば、足りないものを追加でインストールして簡単に共有することができました。。

背景

Android Studioの正式版がリリースされたので、新規プロジェクトはAndroid Studioで開発していくことにしました。一方、古いプロジェクトは移行にまだ時間がかかるので、引き続きEclipseも使っていきます。ただし、Android SDKはサイズが大きいので共有することにしました。

環境

  • Linux Mint 16 Petra (Ubuntu Saucy Salamander (13.10) ベース)
  • Android Studio 1.0.1

内容

  • Android Studio をダウンロードして適当な場所に解凍します。

ダウンロードURL: http://developer.android.com/sdk/index.html

  • Android Studio を起動します。
$ cd {installation home}/bin
$ ./studio.sh

標準インストールかカスタムインストールかを聞かれますが、標準インストールを選択します。

  • Android Studio を一旦終了します。 $HOME/Android/Sdkに新しいAndroid SDKが作成されます。作成されていない場合はAndroid Studioで新規アプリケーションを適当に作成し、ビルドします。

  • Eclipseで使っていた古いAndroid SDKのフォルダには存在せず、新しいAndroid SDKのフォルダにだけ存在するフォルダを古い方にコピーします。

add-ons/addon-google_apis-google-21
build-tools/21.1.2
extras/android/m2repository
extras/google/m2repository
platforms/android-21
system-images/android-21
  • 新しいAndroid SDKのバックアップを取り、古いAndroid SDKへのシンボリックリンクに変更します。
$ cd $HOME/Android
$ cp -rf Sdk Sdk_bak
$ ln -s <古いAndroid SDKのパス> Sdk

その他

共有する過程で、Build-toolsやGoogle Play Services Library を更新してしまい、Eclipse でエラーが出てしまいましたが、以下で解決しました。

  • Google Play Services Library のプロジェクトが Eclipse で開けない。

Libraryを更新した際に、.projectファイルがなくなってしまったので一旦Eclipseのプロジェクトから消した後、再度インポートしました。

  • v7 Support Library のプロジェクトにてリソースが見つからないエラーが発生。
...sdk/extras/android/support/v7/appcompat/res/values-v21/styles_base.xml:75: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionButton'.

Stackoverflow (http://stackoverflow.com/questions/26431676/appcompat-v721-0-0-no-resource-found-that-matches-the-given-name-attr-andro) を参考に、project.properties ファイルの target=android-19 を target=android-21 に修正しました。

3
3
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
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?