コガネブログ

平日更新を目標に Unity や C#、Visual Studio、ReSharper などのゲーム開発アレコレを書いていきます

【Unity】Exception failed: System.Threading.ThreadAbortException: Thread was being aborted.

概要

Exception failed: System.Threading.ThreadAbortException: Thread was being aborted.
  at (wrapper managed-to-native) System.Threading.WaitHandle.Wait_internal(intptr*,int,bool,int)
  at System.Threading.WaitHandle.WaitOneNative (System.Runtime.InteropServices.SafeHandle waitableSafeHandle, System.UInt32 millisecondsTimeout, System.Boolean hasThreadAffinity, System.Boolean exitContext) [0x00044] in <5fa84b4935964448a51c359531ad218d>:0 
  at System.Threading.WaitHandle.InternalWaitOne (System.Runtime.InteropServices.SafeHandle waitableSafeHandle, System.Int64 millisecondsTimeout, System.Boolean hasThreadAffinity, System.Boolean exitContext) [0x00014] in <5fa84b4935964448a51c359531ad218d>:0 
  at System.Threading.WaitHandle.WaitOne (System.Int64 timeout, System.Boolean exitContext) [0x00000] in <5fa84b4935964448a51c359531ad218d>:0 
  at System.Threading.WaitHandle.WaitOne (System.Int32 millisecondsTimeout, System.Boolean exitContext) [0x00019] in <5fa84b4935964448a51c359531ad218d>:0 
  at System.Diagnostics.Process.WaitForExit (System.Int32 milliseconds) [0x00024] in <25c4bb8b13e3482ab9f17890a61c70e1>:0 
  at System.Diagnostics.Process.WaitForExit () [0x00000] in <25c4bb8b13e3482ab9f17890a61c70e1>:0 
  at (wrapper remoting-invoke-with-check) System.Diagnostics.Process.WaitForExit()
  at Google.Android.AppBundle.Editor.Internal.PlayServices.CommandLine.RunViaShellInternal (System.String toolPath, System.String arguments, System.String workingDirectory, System.Collections.Generic.Dictionary`2[TKey,TValue] envVars, Google.Android.AppBundle.Editor.Internal.PlayServices.CommandLine+IOHandler ioHandler, System.Boolean useShellExecution, System.Boolean stdoutRedirectionInShellMode) [0x00341] in UnityProject/Library/PackageCache/com.google.android.appbundle@2cc4a10a13f1/Editor/Scripts/Internal/PlayServices/CommandLine.cs:645 
  at Google.Android.AppBundle.Editor.Internal.PlayServices.CommandLine.RunViaShell (System.String toolPath, System.String arguments, System.String workingDirectory, System.Collections.Generic.Dictionary`2[TKey,TValue] envVars, Google.Android.AppBundle.Editor.Internal.PlayServices.CommandLine+IOHandler ioHandler, System.Boolean useShellExecution, System.Boolean stdoutRedirectionInShellMode) [0x00022] in UnityProject/Library/PackageCache/com.google.android.appbundle@2cc4a10a13f1/Editor/Scripts/Internal/PlayServices/CommandLine.cs:541 
  at Google.Android.AppBundle.Editor.Internal.PlayServices.CommandLine.Run (System.String toolPath, System.String arguments, System.String workingDirectory, System.Collections.Generic.Dictionary`2[TKey,TValue] envVars, Google.Android.AppBundle.Editor.Internal.PlayServices.CommandLine+IOHandler ioHandler) [0x00000] in UnityProject/Library/PackageCache/com.google.android.appbundle@2cc4a10a13f1/Editor/Scripts/Internal/PlayServices/CommandLine.cs:504 
  at Google.Android.AppBundle.Editor.Internal.BuildTools.BundletoolHelper.Run (System.String bundletoolCommand, System.Object[] args) [0x0001f] in UnityProject/Library/PackageCache/com.google.android.appbundle@2cc4a10a13f1/Editor/Scripts/Internal/BuildTools/BundletoolHelper.cs:302 
  at Google.Android.AppBundle.Editor.Internal.BuildTools.BundletoolHelper.BuildBundle (System.String outputFile, System.Collections.Generic.IEnumerable`1[T] moduleFiles, System.Collections.Generic.IEnumerable`1[T] metadataFiles, Google.Android.AppBundle.Editor.Internal.BuildTools.BundletoolHelper+BuildBundleConfigParams buildBundleConfigParams) [0x00068] in UnityProject/Library/PackageCache/com.google.android.appbundle@2cc4a10a13f1/Editor/Scripts/Internal/BuildTools/BundletoolHelper.cs:254 
  at Google.Android.AppBundle.Editor.Internal.BuildTools.AppBundleBuilder.CreateBundle (System.Collections.Generic.List`1[T] moduleDirectoryList, Google.Android.AppBundle.Editor.Internal.CreateBundleOptions options, System.Collections.Generic.IList`1[T] bundleMetadata) [0x000f6] in UnityProject/Library/PackageCache/com.google.android.appbundle@2cc4a10a13f1/Editor/Scripts/Internal/BuildTools/AppBundleBuilder.cs:454 
  at Google.Android.AppBundle.Editor.Internal.BuildTools.AppBundleBuilder.CreateBundle (Google.Android.AppBundle.Editor.Internal.CreateBundleOptions options) [0x00062] in UnityProject/Library/PackageCache/com.google.android.appbundle@2cc4a10a13f1/Editor/Scripts/Internal/BuildTools/AppBundleBuilder.cs:209 
  at Google.Android.AppBundle.Editor.Internal.BuildTools.AppBundleBuilder+<>c__DisplayClass43_0.<CreateBundleAsync>b__0 () [0x00000] in UnityProject/Library/PackageCache/com.google.android.appbundle@2cc4a10a13f1/Editor/Scripts/Internal/BuildTools/AppBundleBuilder.cs:238 
UnityEngine.Debug:LogError (object)
Google.Android.AppBundle.Editor.Internal.BuildTools.AppBundleBuilder:DisplayBuildError (string,string) (at Library/PackageCache/com.google.android.appbundle@2cc4a10a13f1/Editor/Scripts/Internal/BuildTools/AppBundleBuilder.cs:887)
Google.Android.AppBundle.Editor.Internal.BuildTools.AppBundleBuilder/<>c__DisplayClass43_0:<CreateBundleAsync>b__0 () (at Library/PackageCache/com.google.android.appbundle@2cc4a10a13f1/Editor/Scripts/Internal/BuildTools/AppBundleBuilder.cs:245)
System.Threading.ThreadHelper:ThreadStart ()

Play Asset Delivery を使用して Android ビルドしたら
上記のエラーが発生する現象に遭遇した

ビルド完了後に PlayerSettings.SetScriptingDefineSymbolsForGroup
呼び出していたのを呼び出さないようにしたら発生しなくなった

参考サイト様