I can't fix "BuildPlayerWindow+BuildMethodException: 3 errors" - c#

I'm newbie to making my own games. months ago I created my first project. Once the build is complete, it builds normally.
But now, suddenly I can't build again because of this error
v
v
v
1
Internal build system error. BuildProgram exited with code -2146233088.
System.Exception: Failed to resolve target API for values
at AndroidPlayerBuildProgram.AndroidPlayerBuildProgram.GetPathTargetAPI(NPath path)
at AndroidPlayerBuildProgram.AndroidPlayerBuildProgram.EnumerateAPILevelResources(NPath srcAPKResources, NPath dstAPKResources, String resourceName)+MoveNext()
at AndroidPlayerBuildProgram.AndroidPlayerBuildProgram.CopyIdsXML(NPath srcAPKResources)+MoveNext()
at AndroidPlayerBuildProgram.AndroidPlayerBuildProgram.SetupGradleResources()+MoveNext()
at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
at System.Collections.Generic.List`1.AddRange(IEnumerable`1 collection)
at AndroidPlayerBuildProgram.AndroidPlayerBuildProgram.SetupPlayerBuild()
at PlayerBuildProgramLibrary.PlayerBuildProgramBase.RunBuildProgram()
at PlayerBuildProgramTypeWrapper.Run(String[] args)
at Program.Main(String[] args)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
2
BuildFailedException: Incremental Player build failed!
UnityEditor.Modules.BeeBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at <0d6ce211ebbc47e1a35a84c3672ff58f>:0)
UnityEditor.Modules.DefaultBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <0d6ce211ebbc47e1a35a84c3672ff58f>:0)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <5160fdea082d4c479eac116da4ffc2de>:0)
UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.Int32 subtarget, 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 <0d6ce211ebbc47e1a35a84c3672ff58f>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
3
Build completed with a result of 'Failed' in 41 seconds (40802 ms)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
and this
UnityEditor.BuildPlayerWindow+BuildMethodException: 3 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002da] in <0d6ce211ebbc47e1a35a84c3672ff58f>:0
at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <0d6ce211ebbc47e1a35a84c3672ff58f>:0
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
I've been looking for people with the same problem as me. I tried to follow But I can't solve this problem
I did before :
After I encountered a problem I have tried deleting and reinstalling Unity.
I have tried creating a new project. and copy some of the models.
I created an empty projectą¹ƒ
I tried installing another unity version.
But there is no way to solve this problem...

Related

Unity FileNotFoundException "launcherTemplate.gradle" when building for Android

When using Unity 2021.3.6f1 I get a an error saying launcherTemplate.gradle file cannot be found. I don't see it referenced in the project anywhere.
I tried using a custom gradle file, modify existing gradle files but nothing has done the trick so far.
Image
FileNotFoundException: Failed to find $E:/Unity Game Engine/2021.3.6f1/Editor/Data/PlaybackEngines/AndroidPlayer/Tools\GradleTemplates\baseProjectTemplate.gradle
UnityEditor.Android.AndroidBuildPostprocessor.GetTemplate (System.String toolsPath, System.String fileName) (at <0bc7e9c04c1540528b26863a0cb726ae>:0)
UnityEditor.Android.AndroidBuildPostprocessor+<GetDataForBuildProgramFor>d__21.MoveNext () (at <0bc7e9c04c1540528b26863a0cb726ae>:0)
UnityEditor.Modules.BeeBuildPostprocessor.SetupBeeDriver (UnityEditor.Modules.BuildPostProcessArgs args) (at <44a70d1b13cf47e29810e30f45ffae08>:0)
UnityEditor.Modules.BeeBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at <44a70d1b13cf47e29810e30f45ffae08>:0)
Rethrow as BuildFailedException: Exception of type 'UnityEditor.Build.BuildFailedException' was thrown.
UnityEditor.Modules.BeeBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at <44a70d1b13cf47e29810e30f45ffae08>:0)
UnityEditor.Modules.DefaultBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <44a70d1b13cf47e29810e30f45ffae08>:0)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <0bc7e9c04c1540528b26863a0cb726ae>:0)
UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.Int32 subtarget, 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 <44a70d1b13cf47e29810e30f45ffae08>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
It looks like it's related to Unity Hub not installing Android build tooling properly.
From https://forum.unity.com/threads/cant-build-quest-game.1307529/
Unity Hub installer neglects to install the tools directory to this path:
c:\Program Files\Unity\Hub\Editor\2021.3.6f1\Editor\Data\Tools\
Copying over the directory from another recent Unity Editor installation will allow one to make Quest/Android builds again.

UnityStandaloneFileBrowser: ArgumentException Mono.WebBrowser is referenced by System.Windows.Forms

I imported the UnityStandaloneFileBrowser asset to a sample project to test it. Unfortunately I am not able to build the project for Windows.
I needed to set the Scripting Backend to IL2CPP and tried to use .NET Standard 2.0 and .NET 4.X, but both gave me these errors while trying to build:
1. ArgumentException
ArgumentException: The Assembly Mono.WebBrowser is referenced by System.Windows.Forms ('Assets/StandaloneFileBrowser/Plugins/System.Windows.Forms.dll'). But the dll is not allowed to be included or could not be found.
UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List`1[T] alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary`2[TKey,TValue] cache, UnityEditor.BuildTarget target) (at <33fb8f3984d146e083d756d969c06738>:0)
UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List`1[T] alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary`2[TKey,TValue] cache, UnityEditor.BuildTarget target) (at <33fb8f3984d146e083d756d969c06738>:0)
UnityEditor.AssemblyHelper.FindAssembliesReferencedBy (System.String[] paths, System.String[] foldersToSearch, UnityEditor.BuildTarget target) (at <33fb8f3984d146e083d756d969c06738>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
2. UnityEngine.GUIUtility:ProcessEvent
Build completed with a result of 'Failed' in 3 seconds (2740 ms)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
3. UnityEditor.BuildPlayerWindow+BuildMethodException: 3 errors
UnityEditor.BuildPlayerWindow+BuildMethodException: 3 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002ca] in <33fb8f3984d146e083d756d969c06738>:0
at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <33fb8f3984d146e083d756d969c06738>:0
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
Has anyone an idea, what I can do to fix this?
I contacted the asset developer a few times, but I don't get a response. So you are my last hope :-)

Xamarin.Forms does not compile an Android Project

Again, after updating to VS 8.9.1 on Mac I'm getting this error while trying to compile my Android project:
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Tooling.targets(5,5): Error XARSD7023: System.IO.DirectoryNotFoundException: Could not find a part of the path '/Users/giulioserra/Library/Android/sdk'.
at System.IO.Enumeration.FileSystemEnumerator`1[TResult].CreateDirectoryHandle (System.String path, System.Boolean ignoreNotFound) [0x00032] in <36514b14425c4337b446653c547aa9c3>:0
at System.IO.Enumeration.FileSystemEnumerator`1[TResult]..ctor (System.String directory, System.IO.EnumerationOptions options) [0x00048] in <36514b14425c4337b446653c547aa9c3>:0
at System.IO.Enumeration.FileSystemEnumerable`1+DelegateEnumerator[TResult]..ctor (System.IO.Enumeration.FileSystemEnumerable`1[TResult] enumerable) [0x00000] in <36514b14425c4337b446653c547aa9c3>:0
at System.IO.Enumeration.FileSystemEnumerable`1[TResult]..ctor (System.String directory, System.IO.Enumeration.FileSystemEnumerable`1+FindTransform[TResult] transform, System.IO.EnumerationOptions options) [0x00042] in <36514b14425c4337b446653c547aa9c3>:0
at System.IO.Enumeration.FileSystemEnumerableFactory.UserDirectories (System.String directory, System.String expression, System.IO.EnumerationOptions options) [0x00014] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/external/corefx/src/System.IO.FileSystem/src/System/IO/Enumeration/FileSystemEnumerableFactory.cs:104
at System.IO.Directory.InternalEnumeratePaths (System.String path, System.String searchPattern, System.IO.SearchTarget searchTarget, System.IO.EnumerationOptions options) [0x00045] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/external/corefx/src/System.IO.FileSystem/src/System/IO/Directory.cs:180
at System.IO.Directory.EnumerateDirectories (System.String path, System.String searchPattern, System.IO.EnumerationOptions enumerationOptions) [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/external/corefx/src/System.IO.FileSystem/src/System/IO/Directory.cs:196
at System.IO.Directory.EnumerateDirectories (System.String path, System.String searchPattern, System.IO.SearchOption searchOption) [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/external/corefx/src/System.IO.FileSystem/src/System/IO/Directory.cs:193
at Xamarin.Android.Tools.AndroidSdkBase.FindBestNDK (System.String androidSdkPath) [0x00038] in /Users/builder/azdo/_work/278/s/xamarin-android/external/xamarin-android-tools/src/Xamarin.Android.Tools.AndroidSdk/Sdks/AndroidSdkBase.cs:172
at Xamarin.Android.Tools.AndroidSdkBase+<GetAllAvailableAndroidNdks>d__73.MoveNext () [0x000d0] in /Users/builder/azdo/_work/278/s/xamarin-android/external/xamarin-android-tools/src/Xamarin.Android.Tools.AndroidSdk/Sdks/AndroidSdkBase.cs:164
at Xamarin.Android.Tools.AndroidSdkBase.GetValidNdkPath (System.String ctorParam) [0x00068] in /Users/builder/azdo/_work/278/s/xamarin-android/external/xamarin-android-tools/src/Xamarin.Android.Tools.AndroidSdk/Sdks/AndroidSdkBase.cs:128
at Xamarin.Android.Tools.AndroidSdkBase.Initialize (System.String androidSdkPath, System.String androidNdkPath, System.String javaSdkPath) [0x00061] in /Users/builder/azdo/_work/278/s/xamarin-android/external/xamarin-android-tools/src/Xamarin.Android.Tools.AndroidSdk/Sdks/AndroidSdkBase.cs:71
at Xamarin.Android.Tools.AndroidSdkInfo..ctor (System.Action`2[T1,T2] logger, System.String androidSdkPath, System.String androidNdkPath, System.String javaSdkPath) [0x00025] in /Users/builder/azdo/_work/278/s/xamarin-android/external/xamarin-android-tools/src/Xamarin.Android.Tools.AndroidSdk/AndroidSdkInfo.cs:18
at Xamarin.Android.Tasks.MonoAndroidHelper.RefreshAndroidSdk (System.String sdkPath, System.String ndkPath, System.String javaPath, Microsoft.Build.Utilities.TaskLoggingHelper logHelper) [0x00005] in <e0b267300cf54583bbaa8d3ab5dc4081>:0
at Xamarin.Android.Tasks.ResolveSdks.RunTask () [0x000ac] in <e0b267300cf54583bbaa8d3ab5dc4081>:0
at Xamarin.Android.Tasks.AndroidTask.Execute () [0x00000] in <e0b267300cf54583bbaa8d3ab5dc4081>:0 (XARSD7023) (HangoverBusiness.Android)
I tried to delete bin and obj files but nothing, this problem only manifests in the Android project, while the IOS version works fine.
Env:
Mac OS Catalina
VS 8.9.1
Any hint?
Workaround is now added in prerelease.
https://learn.microsoft.com/en-us/visualstudio/releasenotes/vs2019-mac-preview-relnotes
Workaround:- In some cases, Android projects may fail to build with an error The Java SDK could not be found, please set the path to it in the Xamarin.Android SDKs settings panel. A workaround is to execute the following command in a Terminal:
mkdir -p ~/Library/Android/sdk
Looking at the developer community portal this is a bug introduced in v8.9.1. It also specifies a workaround: manually copy the Android SDK files from the default path (found in the settings screen, see below) to the hardcoded path in the error message. In your case /Users/giulioserra/Library/Android/sdk
A better way for me instead of copying the files is a symbolic link, because I use the Android sdk for multiple applications and users and it takes much disk space.
The symlink solution worked for me:
ln -s /Path/to/real/sdk /Path/from/error/message

Unity won't export for android

After upgrading unity from version 5.3.4 to 2018, can't publish.
Build completed with a result of 'Failed'
UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x0021f] in /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPlayerWindowBuildMethods.cs:187
at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x0007f] in /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPlayerWindowBuildMethods.cs:94
UnityEngine.GUIUtility:processEvent(Int32, IntPtr

UITest failed with : "SetUp : System.InvalidOperationException"

I can't use UITest anymore with my xamarin project since the last update of xamarin on the stable channel with Xcode 8.2.
Everytime, when I launch the test, I have an error : "SetUp : System.InvalidOperationException : Sequence contains no matching element". My test series doesn't change from a long time and works well before...
So I don't know how to correct this problem now...
The stack trace :
at System.Linq.Enumerable.First[TSource] (System.Collections.Generic.IEnumerable1[T] source, System.Func2[T,TResult] predicate) [0x00065] in /private/tmp/source-mono-4.6.0/bockbuild-mono-4.6.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/System.Core/System/Linq/Enumerable.cs:965
at Xamarin.UITest.iOS.Instruments.GetAutomationTemplatePath () [0x00031] in :0
at Xamarin.UITest.iOS.Instruments.StartInstrumentsInternal (System.String targetApplication, Xamarin.UITest.iOS.iOSRunType runType, System.String deviceId, System.String runLoopPath, Xamarin.UITest.Configuration.AppDataMode appDataMode, System.Predicate`1[T] dropLine) [0x00006] in :0
at Xamarin.UITest.iOS.Instruments.StartInstruments (System.String targetApplication, Xamarin.UITest.iOS.iOSRunType runType, System.String deviceId, Xamarin.UITest.Configuration.AppDataMode appDataMode) [0x00012] in :0
at Xamarin.UITest.iOS.iOSAppLauncher.RunAppInEmulatorInternal (System.String application, Xamarin.UITest.iOS.Instruments instruments, Xamarin.UITest.Shared.Http.HttpClient httpClient, System.Uri deviceUri, Xamarin.UITest.Shared.Artifacts.ArtifactFolder artifactFolder, Xamarin.UITest.Configuration.AppDataMode appDataMode, System.String deviceIdentifier) [0x00095] in :0
at Xamarin.UITest.iOS.iOSAppLauncher.RunAppInEmulator (Xamarin.UITest.Shared.iOS.AppBundle appBundle, Xamarin.UITest.iOS.Instruments instruments, Xamarin.UITest.Shared.Http.HttpClient httpClient, System.Uri deviceUri, Xamarin.UITest.Shared.Artifacts.ArtifactFolder artifactFolder, Xamarin.UITest.Configuration.AppDataMode appDataMode, System.String deviceIdentifier) [0x00099] in :0
at Xamarin.UITest.iOS.iOSAppLauncher.LaunchApp (Xamarin.UITest.Configuration.IiOSAppConfiguration appConfiguration, Xamarin.UITest.Shared.Http.HttpClient httpClient, Xamarin.UITest.TestCloud.TestCloudiOSAppConfiguration testCloudAppConfiguration, Xamarin.UITest.Shared.Http.HttpClient testCloudWsClient) [0x000e4] in :0
at Xamarin.UITest.iOS.iOSApp..ctor (Xamarin.UITest.Configuration.IiOSAppConfiguration appConfiguration) [0x002db] in :0
at Xamarin.UITest.Configuration.iOSAppConfigurator.StartApp (Xamarin.UITest.Configuration.AppDataMode appDataMode) [0x00017] in :0
at Ac.Test.TestV35.BeforeEachTest () [0x00012] in /Users/ShaprAdmin/Documents/ac/Ac.Test/TestV35.cs:17
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in /private/tmp/source-mono-4.6.0/bockbuild-mono-4.6.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System.Reflection/MonoMethod.cs:305
Thank you!
try to grab the newest Xcode and
then beside proper NUnit version (2.6.x and proper NUnitTestAdapter 2.1.0)
try do upgrade/downgrade the Xamarin.UITest package to version 2.5.
For me it was not working (with same error) for 2.7 for 2.5 it's ok.
Regards,

Categories

Resources