質問: 環境 windows10 unity2018.2.13f1 unityもteratailも初めたばかりです。 unityで実機でテストしようと、build and runするとエラーがたくさん出てしまいます。 エラーに至るまでにやったこと ・Admobの実装 ・「環境変数」のシステム環境変数の JAVA_HOME のPathを実際のPathに設定 ・androidプラットフォームをスイッチ ・「Asset」「Plugins」「Android」以下に *.jar, *.aar コピー ・external toolsにSDKとJDKのパスを入力 以下のようなエラーはどうすれば解決しますか? エラー1 `CommandInvokationFailure: Gradle build failed. C:\Program Files\Java\jdk1.8.0_181\bin\java.exe -classpath "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-4.2.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx2048m" "assembleRelease"` `stderr[` `FAILURE: Build failed with an exception.` `* What went wrong: A problem occurred configuring root project 'gradleOut'.` `> Could not resolve all files for configuration ':classpath'. > Could not find intellij-core.jar (com.android.tools.external.com-intellij:intellij-core:26.0.1). Searched in the following locations: https://jcenter.bintray.com/com/android/tools/external/com-intellij/intellij-core/26.0.1/intellij-core-26.0.1.jar` `* Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.` `* Get more help at https://help.gradle.org` `BUILD FAILED in 3s ] stdout[ Starting a Gradle Daemon, 3 stopped Daemons could not be reused, use --status for details ] exit code: 1 UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action``1 progress, System.String error) UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action` `1 progress) Rethrow as GradleInvokationException: Gradle build failed UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action` `1 progress)` `UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)` エラー2 `Build completed with a result of 'Failed' UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)` エラー3 `UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x0021f] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:187 at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x0007f] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:94 UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)`
回答: まずはエラー文をGoogle検索しましょう。 「CommandInvokationFailure: Gradle build failed.」で検索すると以下のようなサイトがヒットしました。 どこまで合致するか分かりませんが、記載の内容を試してみてください。 続Unity2017+Androidで色んなSDKを入れた場合のエラー備忘録 【Unity2018対応】Androidビルドでエラーが出る場合の対処法 - おもちゃラボ (2018/10/26 12:00追記) ちゃんと読んでませんでした、本命のエラーは「Could not find intellij-core.jar」ですね。 「Could not find intellij-core.jar unity」で出て来た結果です。 unity3d - Gradle build for android in Unity fails, saying that it could not find intellij-core.jar - Stack Overflow ちゃんと直るかは不明ですがお試しください。