質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.46%
Android

Androidは、Google社が開発したスマートフォンやタブレットなど携帯端末向けのプラットフォームです。 カーネル・ミドルウェア・ユーザーインターフェイス・ウェブブラウザ・電話帳などのアプリケーションやソフトウェアをひとつにまとめて構成。 カーネル・ライブラリ・ランタイムはほとんどがC言語/C++、アプリケーションなどはJavaSEのサブセットとAndroid環境で書かれています。

Unity

Unityは、Unity Technologiesが開発・販売している、IDEを内蔵するゲームエンジンです。主にC#を用いたプログラミングでコンテンツの開発が可能です。

Android Studio

Android Studioは、 Google社によって開発された、 Androidのネイティブアプリケーション開発に特化した統合開発ツールです。

Q&A

解決済

1回答

1621閲覧

UnityでAndroidビルドしようとするとエラーが出ます

lanwin

総合スコア1

Android

Androidは、Google社が開発したスマートフォンやタブレットなど携帯端末向けのプラットフォームです。 カーネル・ミドルウェア・ユーザーインターフェイス・ウェブブラウザ・電話帳などのアプリケーションやソフトウェアをひとつにまとめて構成。 カーネル・ライブラリ・ランタイムはほとんどがC言語/C++、アプリケーションなどはJavaSEのサブセットとAndroid環境で書かれています。

Unity

Unityは、Unity Technologiesが開発・販売している、IDEを内蔵するゲームエンジンです。主にC#を用いたプログラミングでコンテンツの開発が可能です。

Android Studio

Android Studioは、 Google社によって開発された、 Androidのネイティブアプリケーション開発に特化した統合開発ツールです。

0グッド

0クリップ

投稿2021/09/19 02:37

前提・実現したいこと

UnityでAndroidビルドしようとするとエラーが出ます。
build and runの際にGradle build failed.というメッセージが出た後、エラーが4つ出てビルド出来ません。
エラーメッセージを検索して出てきた解決法を色々試しましたがうまくいきませんでした。
Unity・teratail共に始めたばかりなので丁寧に説明して頂けると有難いです。
OSはwin10、Unityのバージョンは2020.3.18f1です。

発生している問題・エラーメッセージ

エラー1 FAILURE: Build failed with an exception. * Where: Build file 'C:\Users\RICK\OneDrive\デスクトップ\Unity project\swipeCar export\launcher\build.gradle' line: 3 * What went wrong: A problem occurred evaluating project ':launcher'. > Failed to apply plugin [id 'com.android.internal.application'] > Your project path contains non-ASCII characters. This will most likely cause the build to fail on Windows. Please move your project to a different directory. See http://b.android.com/95744 for details. This warning can be disabled by adding the line 'android.overridePathCheck=true' to gradle.properties file in the project directory. * 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 Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&) エラー2 CommandInvokationFailure: Gradle build failed. C:\Users\RICK\OneDrive\デスクトップ\Unity\2020.3.18f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -classpath "C:\Users\RICK\OneDrive\デスクトップ\Unity\2020.3.18f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-6.1.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease" stderr[ FAILURE: Build failed with an exception. * Where: Build file 'C:\Users\RICK\OneDrive\デスクトップ\Unity project\swipeCar export\launcher\build.gradle' line: 3 * What went wrong: A problem occurred evaluating project ':launcher'. > Failed to apply plugin [id 'com.android.internal.application'] > Your project path contains non-ASCII characters. This will most likely cause the build to fail on Windows. Please move your project to a different directory. See http://b.android.com/95744 for details. This warning can be disabled by adding the line 'android.overridePathCheck=true' to gradle.properties file in the project directory. * 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 Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 ] stdout[ ] exit code: 1 UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <c8b3b39837d14a59b516963b78bf9032>:0) UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <c8b3b39837d14a59b516963b78bf9032>:0) UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <c8b3b39837d14a59b516963b78bf9032>:0) UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at <c8b3b39837d14a59b516963b78bf9032>:0) UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at <c8b3b39837d14a59b516963b78bf9032>: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 <c8b3b39837d14a59b516963b78bf9032>:0) UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <c8b3b39837d14a59b516963b78bf9032>:0) UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <c8b3b39837d14a59b516963b78bf9032>:0) Rethrow as BuildFailedException: Exception of type 'UnityEditor.Build.BuildFailedException' was thrown. UnityEditor.Android.PostProcessor.CancelPostProcess.AbortBuild (System.String title, System.String message, System.Exception ex) (at <c8b3b39837d14a59b516963b78bf9032>:0) UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <c8b3b39837d14a59b516963b78bf9032>:0) UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <c8b3b39837d14a59b516963b78bf9032>:0) UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <c8b3b39837d14a59b516963b78bf9032>:0) UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <5ad584e208e14caaa9e6b2e6027e9204>:0) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&) エラー3 Build completed with a result of 'Failed' in 29 seconds (28901 ms) UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&) エラー4 UnityEditor.BuildPlayerWindow+BuildMethodException: 3 errors at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002ca] in <5ad584e208e14caaa9e6b2e6027e9204>:0 at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <5ad584e208e14caaa9e6b2e6027e9204>:0 UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

該当のソースコード

ソースコード

試したこと

補足情報(FW/ツールのバージョンなど)

ここにより詳細な情報を記載してください。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

エラーメッセージとして何でダメなのか明確に示されています。

text

1* What went wrong: 2A problem occurred evaluating project ':launcher'. 3> Failed to apply plugin [id 'com.android.internal.application'] 4 > Your project path contains non-ASCII characters. This will most likely cause the build to fail on Windows. Please move your project to a different directory. See http://b.android.com/95744 for details. This warning can be disabled by adding the line 'android.overridePathCheck=true' to gradle.properties file in the project directory.

わからなければ Your project path contains non-ASCII characters. で検索してみるとよいでしょう。

投稿2021/09/19 03:13

bboydaisuke

総合スコア5277

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

lanwin

2021/09/19 04:47 編集

回答ありがとうございます。 プロジェクトのパスにASCII文字以外が使われているということですね。 パスを調べてみたところASCII文字以外は使われていなかったのですが、デスクトップがOneDriveと同期していたのでバックアップを停止させるとなぜか元のエラーは出なくなり、別のエラーが出ました。 FAILURE: Build failed with an exception. * What went wrong: Could not determine the dependencies of task ':launcher:compileReleaseJavaWithJavac'. > Installed Build Tools revision 31.0.0 is corrupted. Remove and install again using the SDK Manager. * 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 8s Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.46%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問