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

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 :-)

Related

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

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...

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.

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

Unity and Admob Integration

I have added the admob Package to my project but when i try to build the apk file this error shows up:
CommandInvokationFailure: Unable to convert classes into dex format.
C:/Program Files/Java/jdk1.8.0_25\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Users/PC-Boulot/AppData/Local/Android/sdk\tools" -Dfile.encoding=UTF8 -jar "C:\PROGRAM FILES\UNITY\EDITOR\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -
stderr[
Error:Invalid command dx
]
stdout[
]
exit code: 64
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.AndroidSDKTools.RunCommandInternal (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.AndroidSDKTools.RunCommandSafe (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
What Unity version are you using ? this used to happen due to a Unity bug which has been resolved since then.
Try to migrate your project to Unity 2017.1 to see if that helps.

Categories

Resources