0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Unity 6.7から、Editor上でAndroidの「Target API Level」と「Compile API Level」を別々に指定できるようになる

0
Posted at

Unity 6.7から、UnityのAndroidビルド設定において、Androidの「Target API Level(targetSdkVersion)と「Compile API Level(compileSdkVersion)」を、EditorのPlayer Settingsから別々に指定できるようになります。

該当のリリースノートはこちら

Android: Added: Added PlayerSettings.Android.compileSdkVersion to set the compile API level independently of the target API level, including sub-integer (major.minor) precision.

本投稿は、Unity 6.7 alpha6時点の情報です。正式リリース版では挙動・仕様が変わる可能性もあります。


Unity 6.6以前は、「Target API Level」を設定すると、それが自動的にコンパイル時に使用されるAndroid SDKバージョンとしても適用されていました。つまりUnity Editor上で、「Target API Level」の設定は、Androidの「targetSdkVersion」と「compileSdkVersion」の両方に適用されていました。

targetSdkVersionとcompileSdkVersionについて、詳しくは次のAndroid公式ドキュメントを参照してください。

Unity 6.7から、Player Settingsに、新たに「Compile API Level」が追加されました。これにより、

  • Unity Editor上の「Target API Level」・・・Androidの「targetSdkVersion」
  • Unity Editor上の「Compile API Level」・・・Androidの「compileSdkVersion」

を別々にUnity Editor上から指定できるようになりました。

次に示すのは、Unity EditorのPlayer Settings > Android > Other Settingsのそれぞれのバージョンのスクリーンショットです。Unity 6000.7.0a6には、「Compile API Level」が追加されています。

Unity 6000.6.0f1 Unity 6000.7.0a6
ss0.png ss1.png

Androidアプリ開発において、「compileSdkVersionは最新にしたいが、targetSdkVersionはまだ対応できていないので最新にできない」という状況は一般的です。Unityを用いたAndroidアプリ開発においても、プロジェクトによってはそのような状況はおこりえます。

今までもGradle Templateなどを使えばUnityプロジェクトでも、AndroidのtargetSdkVersionとcompileSdkVersionを別々に指定することはできました。

Unity 6.7からは、Editor上の操作だけで、targetSdkVersionとcompileSdkVersionの個別設定が完結するのは嬉しいですね!

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?