Unity エラー対処一覧
プロジェクトファイル操作系
Assertion failed on expression: ‘exception ==SCRIPTING_NULL’
Assertion failed on expression: ‘exception ==SCRIPTING_NULL’
原因:フォルダ名に日本語や空白など英語以外が入ってる?
解決策:プロジェクトファイルのパスを変える。
Duplicate identifier xxxxxxxxx. File “path”
Duplicate identifier xxxxxxxxx. File “path”
原因:バージョン管理のコンフリクト。
解決策:File pathに書かれているファイルをメモ帳などで開く。下記のような文字列があるはず。&以下の数字は異なるかもしれない。恐らくレベル内にあるオブジェクトに振ったIDだと思われる。&以下が全く同じ数字が存在する場合にどちらかを削除。数字列の下の文字も削除。
---!u!1 &7333412679
hoge
------------------
Could not create asset from xxx: file could not be read
Could not create asset from Assets/xxx: file could not be read.
原因:GitなどからProject Fileをコピーして来ると、Package Managerのファイルが正常にロードされてないことがある。
解決策:再インポート。
Android関連
Gradle build failed. See the Console for details.
CommandInvokationFailure: Gradle build failed.
C:\Program Files\UnityEditor\2020.2.1f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -classpath "C:\Program Files\UnityEditor\2020.2.1f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-5.6.4.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"
stderr[
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\user\[プロジェクトパス]\Temp\gradleOut\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 4s
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
]
stdout[
Starting a Gradle Daemon, 1 incompatible Daemon 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 <5cf84f2cc5134566935b135856517214>:0)
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <5cf84f2cc5134566935b135856517214>:0)
UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <5cf84f2cc5134566935b135856517214>:0)
UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at <5cf84f2cc5134566935b135856517214>:0)
UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at <5cf84f2cc5134566935b135856517214>: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 <5cf84f2cc5134566935b135856517214>:0)
UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <5cf84f2cc5134566935b135856517214>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <5cf84f2cc5134566935b135856517214>: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 <5cf84f2cc5134566935b135856517214>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <5cf84f2cc5134566935b135856517214>: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 <5cf84f2cc5134566935b135856517214>:0)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <5cf84f2cc5134566935b135856517214>: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 <1e441e8684a14fe4b8f8a926d91afc3a>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
解決策:C:やD: 直下にプロジェクトファイルを置く。
プロジェクトのパス内に日本語が入らないようにすることで解決します。
原因:私の環境だとデスクトップを指定すると「Desktop」ではなく「デスクトップ」となっているので、日本語名が挟まってエラーが出ていました。
adb: failed to install failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE]: Package com.xxxx.xxxx signatures do not match previously installed version; ignoring!]
CommandINvokationFailure: Unable to install APK to device.Please make sure the Android SDK is installed and is properly configured in the Editor. See the Console for more details.
adb: failed to install failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE]: Package com.xxxx.xxxx signatures do not match previously installed version; ignoring!]
原因:すでにインストール済みのパッケージとインストールしようとするパッケージの情報が一致せず、インストールに失敗。
解決策:Androidにインストールしたパッケージを削除
HoloLens
No Valid MRTK Profile for build target platform
No Valid MRTK Profile for build target platform
解決策: [Click Assign MRTK Default]をクリック。
Il2cppBuildCache/UMP/ARM64/buildstate/tundra.log.json for struvtured logging
Il2cppBuildCache/UMP/ARM64/buildstate/tundra.log.json for struvtured logging
解決策:[Library] フォルダ下の[Il2cppBuildCache]フォルダを削除
その他
OVRPllugin.dll expected x64 architecture,but was Unknown architecture,You must recompile your plugin for x64 architecture.
OVRPllugin.dll expected x64 architecture,but was Unknown architecture,You must recompile your plugin for x64 architecture.
解決策:Oculus integrationの再インストール。
Building Library/Bee/artifacts/android/xxxx.o failed with output
Building Library/Bee/artifacts/android/xxxx.o failed with output
上記のようなエラーが400〜600でる。
原因:サポート対象外のPixyz Pluginをインストール。
解決策:Pixyz Pluginのアンインストール。
Failed to load : File may be corrupted or was serialized with a new version of Unity.
解決策: Target Platformを何でもいいので別にしてから、元のPlatformに戻す。
特定環境でDecalが映らない。
Graphic APIをGPUに合ったものを選択。1番上のAPIが適用される。