確認環境
* Unity2017 2.0f1
* Gradleビルド
こんなエラーや、
Build failure
com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Landroid/support/annotation/AnimRes; See the Console for details.
こんなエラーや、
UnityEditor.BuildPlayerWindow+BuildMethodException: 3 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x00207] in /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPlayerWindowBuildMethods.cs:172
at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x00050] in /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPlayerWindowBuildMethods.cs:83
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
こんなエラーや、
CommandInvokationFailure: Gradle build failed.
/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/java -classpath "/Applications/Unity/PlaybackEngines/AndroidPlayer/Tools/gradle/lib/gradle-launcher-2.14.jar" org.gradle.launcher.GradleMain "assembleRelease"
stderr[
FAILURE: Build failed with an exception.
なにか原因かわからないため、解決するためにやったこと。
-
Player Settings の Publishing Setting > Custom Gradle Templateにチェックをいれ、
カスタムのgradleをいじれる、mainTemplateをさわって、また戻したり。
-
Unityを再起動したり
-
Android SDKのToolsのAPIバージョンをあげたり。
https://answers.unity.com/questions/1435579/how-can-i-fix-this-error-unityeditorbuildplayerwin.html
-
https://issuetracker.unity3d.com/issues/android-project-with-iap-plugin-fails-to-build-with-gradle-release-mode-only-and-throws-java-dot-io-dot-ioexception
Unityのバージョンを疑ったり
で、何かのタイミングで、エラーがでなくなり、無事APKファイルが履かれました…!