UnityでAndroid向けにビルドできない
Unityでスマホアプリを作成するプロジェクトに参加することになり、
環境構築後にAndroid向けにビルドしたのですが、
下記のエラーにより、ビルドに失敗してしまいました。
調べている中で、BuildSystemを「Gradle」から「Internal」に変更すれば解決するとありましたが、
プロジェクトの都合上「Gradle」でビルドできればと考えております。
原因がわからず手詰まりの状況です。
お力を貸していただけないでしょうか・・・。
発生している問題・エラーメッセージ
エラーメッセージ1
CommandWithNoStdoutInvokationFailure: Gradle initialization failed. UnityEditor.Android.Command.RunWithShellExecute (System.String command, System.String args, System.String workingdir, System.String errorMsg) (at <103137eb219949558cde9ab87892d16a>:0) UnityEditor.Android.AndroidJavaTools.RunJavaWithShellExecute (System.String args, System.String workingdir, System.String error) (at <103137eb219949558cde9ab87892d16a>:0) UnityEditor.Android.GradleWrapper.WarmupGradle (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingDir, System.String baseCommand) (at <103137eb219949558cde9ab87892d16a>:0) Rethrow as GradleInvokationException: Gradle initialization failed. UnityEditor.Android.GradleWrapper.WarmupGradle (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingDir, System.String baseCommand) (at <103137eb219949558cde9ab87892d16a>:0) UnityEditor.Android.PostProcessAndroidPlayer+<ExecuteWarmup>c__AnonStorey0.<>m__0 () (at <103137eb219949558cde9ab87892d16a>:0) System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) (at <d7ac571ca2d04b2f981d0d886fa067cf>:0) System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at <d7ac571ca2d04b2f981d0d886fa067cf>:0) System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at <d7ac571ca2d04b2f981d0d886fa067cf>:0) System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) (at <d7ac571ca2d04b2f981d0d886fa067cf>:0) System.Threading.ThreadHelper.ThreadStart () (at <d7ac571ca2d04b2f981d0d886fa067cf>:0) UnityEngine.UnhandledExceptionHandler:<RegisterUECatcher>m__0(Object, UnhandledExceptionEventArgs) (at ?)
エラーメッセージ2
CommandInvokationFailure: Gradle build failed. C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\OpenJDK\Windows\bin\java.exe -classpath "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-4.6.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease" stderr[ FAILURE: Build failed with an exception. * What went wrong: java.io.IOException: Unable to establish loopback connection * 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 ] stdout[ Starting a Gradle Daemon, 2 stopped Daemons could not be reused, use --status for details ] exit code: 1 UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <103137eb219949558cde9ab87892d16a>:0) UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <103137eb219949558cde9ab87892d16a>:0) UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <103137eb219949558cde9ab87892d16a>:0) UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at <103137eb219949558cde9ab87892d16a>:0) UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at <103137eb219949558cde9ab87892d16a>:0) Rethrow as GradleInvokationException: Gradle build failed UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at <103137eb219949558cde9ab87892d16a>:0) UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <103137eb219949558cde9ab87892d16a>:0) UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <103137eb219949558cde9ab87892d16a>:0) UnityEditor.BuildPipeline:BuildPlayer(BuildPlayerOptions) (at ?)
試したこと
- Gradleのアップグレード
補足情報
Unity2018.4.3f1
Android Studio 3.5.1
Windows10
参考
おもちゃラボ
http://nn-hokuson.hatenablog.com/entry/2017/09/05/202327
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2019/12/23 02:34