3
2

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 3 years have passed since last update.

[Unity]SDK Managerを手動で入れる

Posted at

なにをするのか?

UnityのAndroid SDKがないときに手動でいれる.

環境

  • Windows 10 Pro
  • Unity 2019.4.8f1

なんでやったか?

2020年11月2日以降にGoogle Playで公開するアプリは Android 10(API 29以上)にする必要があったため.

image.png

APIレベルを指定する方法

Unityでは,ビルドするときにAPIレベルを指定することができます.

Build Settings > Player > Identification > Minimum API Levelここを変えることで変更することができます.

image.png

ここを指定してビルドしたときに,ビルドが成功すればAPIレベルを指定したものでアプリが作られます.

しかし,次の画像のように,Android SDK が見つからないというエラーが出た場合は手動でSDKを入れて対処することができます.

手動でAndroid SDKを入れる

Android SDKを手に入れる

  1. Android Studioを起動し,Configure > SDKManager を選択します.(Android Studioを入れていない方)
  2. 手に入れたいAPIレベルを選択します.(今回はAndroid10.0 API Level29)

image.png

  1. Applyを押して待ちます.
  2. インストールが終わったら,Andorid SDK Locationのパスをコピーして,エクスプローラなどで開きます.
  3. 開いたフォルダのplatformsを選択するとandroid-29などインストールしたデータがあると思います.

UnityにSDKを追加する

まずUnity内のAndroid SDKのパスを調べます.
Preferences > External Tools > Androidにパスが書いてあるのでコピーしてみてみましょう.

image.png

コピーしたフォルダの中にplatformsがあるのでその中に行きます.

するとandroid-28(自分の場合)などのフォルダがあると思います.ここにandroid-29がないので,Unityで見つけられていません.

ここにAndroid Studioからインストールしたandroid-29(入れたいフォルダ)を追加するとUnityがそれを使ってビルドすることができるようになります.

ビルドする

ここまでくると更新したSDKでビルドを行うことができると思います!

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?