LoginSignup
1
2

More than 1 year has passed since last update.

いつもぶつかって何となく調べて解決してきたAndroid周りの対応 その2

Posted at

前置き

  • いつも同じようなエラーが発生する(気がする)……
  • 多分Unityのversion upしたタイミングな気がしている……
  • でもその度調べて解決してるが、結局いつも原因忘れてしまっている……
  • 以前書いた、「いつもぶつかって何となく調べて解決してきたAndroid周りの対応」とはまた別の事象
    • 以前の件はAdMobに関係するところ
  • 今回はUnityでのAndroidビルド時に発生

環境

  • Unity2020.3.9f1

事象

  • UnityでのAndroidビルド時に下記のエラーが発生。
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/xxx/git/InfiniteStrawberry/Temp/gradleOut/launcher/build.gradle' line: 3

* What went wrong:
A problem occurred evaluating project ':launcher'.
> Failed to apply plugin [id 'com.android.internal.version-check']
   > Minimum supported Gradle version is 5.6.4. Current version is 5.1.1. If using the gradle wrapper, try editing the distributionUrl in /Users/nir/git/InfiniteStrawberry/Temp/gradleOut/launcher/gradle/wrapper/gradle-wrapper.properties to gradle-5.6.4-all.zip

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s

UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&) (at /Users/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:189)

結論

  • gradleのpath(Preference > External Tools)の指定が誤っていた

解決方法

  • Preference > External Toolsのgradle部分をチェックする形にした
    image.png
  • 前のUnityのversionの時には逆に指定しないと通らなくて、直接指定してた
    • ただ、その設定を今回引き継いだら今回のversionだとNGだった……
    • 前versionだと直接UnityをDL&installしていたが、今versionはUnityHub経由でinstallして、Android関連のモジュールもUnityHubで追加できている状態なので、ずっとUnityHubで管理している人は多分同事象は発生しない?

その他

  • 調べていく上で、同じようなエラーが発生した場合、プロジェクトのパスにASCII文字以外(日本語とか)が含まれると発生するケースもあるらしい

参考資料

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